UPSTREAM: cdc_ncm: do not call usbnet_link_change from cdc_ncm_bind
authorBjørn Mork <bjorn@mork.no>
Fri, 8 Jul 2016 18:14:51 +0000 (11:14 -0700)
committermobile promotions <svcmobile_promotions@nvidia.com>
Thu, 20 Oct 2016 04:19:46 +0000 (21:19 -0700)
commit8ba21ae06ba76b6be01b1a1fcd24b3acf96b4b85
tree92acb6257cb9bf24032795b9f1b09c2092362faa
parent7b9930a12a42574c67dd28c235b8fc78a78c05ab
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
Bug 1797728
(cherry picked from commit e0328ff123d1085b05f4e8b0ccde9c9e5203b61c)
Signed-off-by: Mithun Maragiri <mmaragiri@nvidia.com>
Reviewed-on: http://git-master/r/1213267
GVS: Gerrit_Virtual_Submit

(cherry picked from commit e69933605e81838544cceecfa44b1c86010b5287)
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Change-Id: I67daf32a73a434f3703c00646c6e2f79dc8d63c0
Reviewed-on: http://git-master/r/1221320
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
drivers/net/usb/cdc_ncm.c