netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] include/net/genetlink.h: Allow genlmsg_cancel to accept a NULL argument
@ 2011-01-28 15:43 Julia Lawall
  2011-02-01 22:54 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2011-01-28 15:43 UTC (permalink / raw)
  To: davem, netdev, linux-kernel, paul.moore, kernel-janitors

nlmsg_cancel can accept NULL as its second argument, so for similarity,
this patch extends genlmsg_cancel to be able to accept a NULL second
argument as well.

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 include/net/genetlink.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 8a64b81..b4c7c1c 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -195,7 +195,8 @@ static inline int genlmsg_end(struct sk_buff *skb, void *hdr)
  */
 static inline void genlmsg_cancel(struct sk_buff *skb, void *hdr)
 {
-	nlmsg_cancel(skb, hdr - GENL_HDRLEN - NLMSG_HDRLEN);
+	if (hdr)
+		nlmsg_cancel(skb, hdr - GENL_HDRLEN - NLMSG_HDRLEN);
 }
 
 /**

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-02-04  4:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-28 15:43 [PATCH] include/net/genetlink.h: Allow genlmsg_cancel to accept a NULL argument Julia Lawall
2011-02-01 22:54 ` David Miller
2011-02-02  5:51   ` Julia Lawall
2011-02-02  6:17   ` Julia Lawall
2011-02-04  4:43     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).