diff options
author | Oliver Neukum <oneukum@suse.com> | 2016-03-07 11:31:10 +0100 |
---|---|---|
committer | Tasayco Loarte, VictorX <victorx.tasayco.loarte@intel.com> | 2016-09-26 11:20:27 +0100 |
commit | a45d2007deb69741601a4bf8c5014f4d21983326 (patch) | |
tree | f2b1f4b6ed30cf0bc7a5c7bdc4b0d36651e965e6 | |
parent | 1890a33bd55e9fd9c0a247b36b2c4063be571385 (diff) | |
download | x86-a45d2007deb69741601a4bf8c5014f4d21983326.tar.gz |
UPSTREAM: usbnet: cleanup after bind() in probe()
Bug: 28744625
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.
(cherry picked from commit 1666984c8625b3db19a9abc298931d35ab7bc64b)
Bug: 31554728
Change-Id: Iec7d659d903eab0adee1c91cb8f5b84e9775c09d
Tracked-On: https://jira01.devtools.intel.com/browse/AW-1795
Signed-off-by: Oliver Neukum <ONeukum@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Yueyao (Nathan) Zhu <yueyao@google.com>
Signed-off-by: Victor Tasayco Loarte <victorx.tasayco.loarte@intel.com>
-rw-r--r-- | 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 e03a2b1c12f5..c300a96376c3 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -1758,6 +1758,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: return status; |