diff options
author | Oliver Neukum <oneukum@suse.com> | 2016-03-07 11:31:10 +0100 |
---|---|---|
committer | Ziyan <jaraidaniel@gmail.com> | 2016-10-29 01:34:10 +0200 |
commit | ab7574d61ef85682b19f2ac4dfadff0bfa019866 (patch) | |
tree | b0d35c68711a18a79643fed3914e0de162f83d97 | |
parent | 4e6fa4e26dcf04627b86fe73b84c178ab1456b54 (diff) | |
download | kernel_samsung_tuna-ab7574d61ef85682b19f2ac4dfadff0bfa019866.zip kernel_samsung_tuna-ab7574d61ef85682b19f2ac4dfadff0bfa019866.tar.gz kernel_samsung_tuna-ab7574d61ef85682b19f2ac4dfadff0bfa019866.tar.bz2 |
usbnet: cleanup after bind() in probe()
In case bind() works, but a later error forces bailing
in probe() in error cases work and a timer may be scheduled.
They must be killed. This fixes an error case related to
the double free reported in
http://www.spinics.net/lists/netdev/msg367669.html
and needs to go on top of Linus' fix to cdc-ncm.
Change-Id: I43b1673bc31b3af05789e461b39c55062735cc56
Signed-off-by: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rwxr-xr-x | drivers/net/usb/usbnet.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index ae0bd39..88a2567 100755 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -1518,6 +1518,13 @@ out3: if (info->unbind) info->unbind (dev, udev); out1: + /* subdrivers must undo all they did in bind() if they + * fail it, but we may fail later and a deferred kevent + * may trigger an error resubmitting itself and, worse, + * schedule a timer. So we kill it all just in case. + */ + cancel_work_sync(&dev->kevent); + del_timer_sync(&dev->delay); free_netdev(net); out: usb_put_dev(xdev); |