netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] NET: netpoll, fix potential NULL ptr dereference
@ 2010-03-16 15:29 Jiri Slaby
  2010-03-16 16:57 ` Laurent Chavey
  2010-03-16 17:12 ` Matt Mackall
  0 siblings, 2 replies; 7+ messages in thread
From: Jiri Slaby @ 2010-03-16 15:29 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, jirislaby, Daniel Borkmann

Stanse found that one error path in netpoll_setup dereferences npinfo
even though it is NULL. Avoid that by adding new label and go to that
instead.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Daniel Borkmann <danborkmann@googlemail.com>
Cc: David S. Miller <davem@davemloft.net>
---
 net/core/netpoll.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 7aa6972..d4ec38f 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -735,7 +735,7 @@ int netpoll_setup(struct netpoll *np)
 		npinfo = kmalloc(sizeof(*npinfo), GFP_KERNEL);
 		if (!npinfo) {
 			err = -ENOMEM;
-			goto release;
+			goto put;
 		}
 
 		npinfo->rx_flags = 0;
@@ -845,7 +845,7 @@ int netpoll_setup(struct netpoll *np)
 
 		kfree(npinfo);
 	}
-
+put:
 	dev_put(ndev);
 	return err;
 }
-- 
1.7.0.1

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

end of thread, other threads:[~2010-03-18 14:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-16 15:29 [PATCH 1/1] NET: netpoll, fix potential NULL ptr dereference Jiri Slaby
2010-03-16 16:57 ` Laurent Chavey
2010-03-16 17:12 ` Matt Mackall
2010-03-16 17:22   ` Jiri Slaby
2010-03-16 17:56     ` Matt Mackall
2010-03-16 21:29       ` David Miller
2010-03-18 14:55       ` Daniel Borkmann

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).