usb: gadget: Fix rndis unregistration
Net device may be unregistered only if its reference counter is 0.
Reference counter is increased by 1 by register_netdev and
dev_get_by_name functions. Since each call of dev_get_by_name
causes a superfluous increase of reference counter,
it must be followed by a call to dev_put,
decreasing reference counter back to its proper value 1.
Otherwise the unregistration of the net_device, decreasing
reference counter by 1 and waiting for it to be 0, will get stuck forever.
CRs-Fixed: 418630
Change-Id: I68c9802ac67b07e5ffd05ddb14be6119fe10a86f
Signed-off-by:
Anna Perel <aperel@codeaurora.org>
Loading
Please register or sign in to comment