Commit 21edbb22 authored by Jiri Slaby's avatar Jiri Slaby Committed by David S. Miller

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: default avatarJiri Slaby <jslaby@suse.cz>
Cc: Daniel Borkmann <danborkmann@googlemail.com>
Cc: David S. Miller <davem@davemloft.net>
Acked-by: chavey@google.com
Acked-by: default avatarMatt Mackall <mpm@selenic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a2f46ee1
...@@ -735,7 +735,7 @@ int netpoll_setup(struct netpoll *np) ...@@ -735,7 +735,7 @@ int netpoll_setup(struct netpoll *np)
npinfo = kmalloc(sizeof(*npinfo), GFP_KERNEL); npinfo = kmalloc(sizeof(*npinfo), GFP_KERNEL);
if (!npinfo) { if (!npinfo) {
err = -ENOMEM; err = -ENOMEM;
goto release; goto put;
} }
npinfo->rx_flags = 0; npinfo->rx_flags = 0;
...@@ -845,7 +845,7 @@ int netpoll_setup(struct netpoll *np) ...@@ -845,7 +845,7 @@ int netpoll_setup(struct netpoll *np)
kfree(npinfo); kfree(npinfo);
} }
put:
dev_put(ndev); dev_put(ndev);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment