Revert "usb: gadget: f_ncm: Always set current gadget in ncm_bind()"
This reverts commit d2500cd6. The intention of such commit is to allow new gadget bindings with the net device beyond the initial attempt. However, these new bindings are only done _partially_ as the register_netdev() step is skipped, which messes up the gadget reference count. During tear-down the gadget is released leaving the net device with a dev->parent dangling pointer. A subsequent netlink dump operation attempts to access the parents info but triggering a use-after-free. Remove this commit while a better/permanent fix is discussed upstream. Bug: 421120878 Bug: 448463795 Cc: Neill Kapron <nkapron@google.com> Cc: Greg Kroah-Hartman <gregkh@google.com> Signed-off-by:Carlos Llamas <cmllamas@google.com> Cherrypick-From: https://android-review.googlesource.com/q/commit:e4777dcdcfa42b76a2f5ccee7fded3b40663e529 Merged-In: I4f000087ca82087dd2282301e57cb7330f651366 Change-Id: I4f000087ca82087dd2282301e57cb7330f651366
Loading
Please sign in to comment