usb: gadget: gadgetfs: unregister gadget only if it got successfully registered
Gadgetfs driver called usb_gadget_unregister_driver unconditionally, even if it didn't register it earlier due to other failures. This patch fixes this. Reported-by: NVegard Nossum <vegard.nossum@oracle.com> Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com> Tested-by: NVegard Nossum <vegard.nossum@oracle.com> Signed-off-by: NFelipe Balbi <balbi@kernel.org>
Showing
想要评论请 注册 或 登录