]> git.baikalelectronics.ru Git - kernel.git/commit
cdc_ncm: do not call usbnet_link_change from cdc_ncm_bind
authorBjørn Mork <bjorn@mork.no>
Mon, 7 Mar 2016 20:15:36 +0000 (21:15 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Mar 2016 20:54:33 +0000 (15:54 -0500)
commit2b32ec7b019f4bbc72987762d42181919f3cfe2f
treedcec6c71e8c971a59085b6f26003642dd81acd58
parent11ed05836421cd34d7119917d1b3faf6b311b603
cdc_ncm: do not call usbnet_link_change from cdc_ncm_bind

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: 875f500bf603 ("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>
drivers/net/usb/cdc_ncm.c