forked from luck/tmp_suning_uos_patched
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>
This commit is contained in:
parent
a2f46ee1ba
commit
21edbb223e
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user