netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [NETLINK] Check netlink_insert in kernel_create
@ 2004-10-28  3:07 Herbert Xu
  2004-10-28  4:44 ` David S. Miller
  2004-10-28  4:45 ` David S. Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Herbert Xu @ 2004-10-28  3:07 UTC (permalink / raw)
  To: David S. Miller, netdev

[-- Attachment #1: Type: text/plain, Size: 444 bytes --]

Hi:

This patch checks the return value of netlink_insert() in
netlink_kernel_create().  It could fail if someone loads
the same module twice for instance.

Signed-off-by: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> 

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[-- Attachment #2: p --]
[-- Type: text/plain, Size: 364 bytes --]

===== net/netlink/af_netlink.c 1.57 vs edited =====
--- 1.57/net/netlink/af_netlink.c	2004-10-20 15:10:40 +10:00
+++ edited/net/netlink/af_netlink.c	2004-10-28 13:00:33 +10:00
@@ -876,7 +876,10 @@
 	if (input)
 		nlk_sk(sk)->data_ready = input;
 
-	netlink_insert(sk, 0);
+	if (netlink_insert(sk, 0)) {
+		sock_release(sock);
+		return NULL;
+	}
 	return sk;
 }
 

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

end of thread, other threads:[~2004-10-28  5:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-28  3:07 [NETLINK] Check netlink_insert in kernel_create Herbert Xu
2004-10-28  4:44 ` David S. Miller
2004-10-28  5:08   ` Herbert Xu
2004-10-28  5:02     ` David S. Miller
2004-10-28  4:45 ` David S. 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).