提交 8ab10400 编写于 作者: R Rahul Ruikar 提交者: Greg Kroah-Hartman

usb: gadget: at91_udc: Fix error path

In function at91udc_probe()
call put_device() when device_register() fails.
Signed-off-by: NRahul Ruikar <rahul.ruikar@gmail.com>
Signed-off-by: NJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 b14e840d
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册