diff options
author | Jiri Slaby <jslaby@suse.cz> | 2010-03-16 01:29:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-16 17:15:45 -0400 |
commit | 21edbb223ed2af88b090e7945af7d91d672e3aa6 (patch) | |
tree | b159ba512fdbdfe92d896a77109e7c0dadd36f87 /net/core | |
parent | a2f46ee1ba5ee249ce2ca1ee7a7a0ac46529fb4f (diff) |
NET: netpoll, fix potential NULL ptr dereference
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>
Acked-by: chavey@google.com
Acked-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | 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 7aa697253765..d4ec38fa64e6 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -735,7 +735,7 @@ int netpoll_setup(struct netpoll *np) | |||
735 | npinfo = kmalloc(sizeof(*npinfo), GFP_KERNEL); | 735 | npinfo = kmalloc(sizeof(*npinfo), GFP_KERNEL); |
736 | if (!npinfo) { | 736 | if (!npinfo) { |
737 | err = -ENOMEM; | 737 | err = -ENOMEM; |
738 | goto release; | 738 | goto put; |
739 | } | 739 | } |
740 | 740 | ||
741 | npinfo->rx_flags = 0; | 741 | npinfo->rx_flags = 0; |
@@ -845,7 +845,7 @@ int netpoll_setup(struct netpoll *np) | |||
845 | 845 | ||
846 | kfree(npinfo); | 846 | kfree(npinfo); |
847 | } | 847 | } |
848 | 848 | put: | |
849 | dev_put(ndev); | 849 | dev_put(ndev); |
850 | return err; | 850 | return err; |
851 | } | 851 | } |