Skip to contentSkip to conversation

usb: misc: uss720: properly clean up reference in uss720_probe()

PATCH Superseded Greg Kroah-Hartman 1 participant 1 message Feb 23 USB

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH 1/1 usb: misc: uss720: properly clean up reference in uss720_probe()

If get_1284_register() fails, the usb device reference count is incorrect and needs to be properly dropped before returning.

Cc stable <[email protected]>
Assisted-by gkh_clanker_2000
---
 drivers/usb/misc/uss720.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/misc/uss720.c +3 -1
index ec8bd968c4de..2d681eee1f99 100644
@@ -735,8 +735,10 @@ static int uss720_probe(struct usb_interface *intf,
 	 * here. */
 	ret = get_1284_register(pp, 0, &reg, GFP_KERNEL);
 	dev_dbg(&intf->dev, "reg: %7ph\n", priv->reg);
-	if (ret < 0)
+	if (ret < 0) {
+		usb_put_dev(usbdev);
 		return ret;
+	}
 
 	ret = usb_find_last_int_in_endpoint(interface, &epd);
 	if (!ret) {
Signature · 1 line
2.53.0