UPSTREAM: cdc_ncm: do not call usbnet_link_change from cdc_ncm_bind
authorBjørn Mork <bjorn@mork.no>
Fri, 8 Jul 2016 20:24:09 +0000 (13:24 -0700)
committerAmit Pundir <amit.pundir@linaro.org>
Mon, 11 Jul 2016 07:14:27 +0000 (12:44 +0530)
commit3f01d94b5033a2fbd76e92cb48ae5db4b0e35b7d
tree89ee4c7e1a95f3bbb77c94203399194e3f847871
parentf431ff10d16475a860c947d23122f20656ec9bf0
UPSTREAM: cdc_ncm: do not call usbnet_link_change from cdc_ncm_bind

(cherry pick from commit 4d06dd537f95683aba3651098ae288b7cbff8274)

usbnet_link_change will call schedule_work and should be
avoided if bind is failing. Otherwise we will end up with
scheduled work referring to a netdev which has gone away.

Instead of making the call conditional, we can just defer
it to usbnet_probe, using the driver_info flag made for
this purpose.

Fixes: 8a34b0ae8778 ("usbnet: cdc_ncm: apply usbnet_link_change")
Reported-by: Andrey Konovalov <andreyknvl@gmail.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
Change-Id: Id9a6d02bdd98bf495d26595cf2cc90e480746186
Bug: 28744625
drivers/net/usb/cdc_ncm.c