greybus: properly drop device reference
Drop the USB device reference taken at the top of ap_probe() in the event greybus_create_hd() fails. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
parent
6813e35a0e
commit
599dc6aa8e
|
@ -386,8 +386,10 @@ static int ap_probe(struct usb_interface *interface,
|
||||||
udev = usb_get_dev(interface_to_usbdev(interface));
|
udev = usb_get_dev(interface_to_usbdev(interface));
|
||||||
|
|
||||||
hd = greybus_create_hd(&es1_driver, &udev->dev);
|
hd = greybus_create_hd(&es1_driver, &udev->dev);
|
||||||
if (!hd)
|
if (!hd) {
|
||||||
|
usb_put_dev(udev);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
es1 = hd_to_es1(hd);
|
es1 = hd_to_es1(hd);
|
||||||
es1->hd = hd;
|
es1->hd = hd;
|
||||||
|
|
Loading…
Reference in New Issue