Commit 599dc6aa authored by Alex Elder's avatar Alex Elder Committed by Greg Kroah-Hartman

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: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 6813e35a
......@@ -386,8 +386,10 @@ static int ap_probe(struct usb_interface *interface,
udev = usb_get_dev(interface_to_usbdev(interface));
hd = greybus_create_hd(&es1_driver, &udev->dev);
if (!hd)
if (!hd) {
usb_put_dev(udev);
return -ENOMEM;
}
es1 = hd_to_es1(hd);
es1->hd = hd;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment