Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ab10400 authored by Rahul Ruikar's avatar Rahul Ruikar Committed by Greg Kroah-Hartman
Browse files

usb: gadget: at91_udc: Fix error path



In function at91udc_probe()
call put_device() when device_register() fails.

Signed-off-by: default avatarRahul Ruikar <rahul.ruikar@gmail.com>
Signed-off-by: default avatarJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b14e840d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1798,8 +1798,10 @@ static int __init at91udc_probe(struct platform_device *pdev)
	}

	retval = device_register(&udc->gadget.dev);
	if (retval < 0)
	if (retval < 0) {
		put_device(&udc->gadget.dev);
		goto fail0b;
	}

	/* don't do anything until we have both gadget driver and VBUS */
	clk_enable(udc->iclk);