]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
usb: misc: uss720: properly clean up reference in uss720_probe()
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Feb 2026 12:19:43 +0000 (13:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Mar 2026 15:17:12 +0000 (16:17 +0100)
If get_1284_register() fails, the usb device reference count is
incorrect and needs to be properly dropped before returning.  That will
happen when the kref is dropped in the call to destroy_priv(), so jump
to that error path instead of returning directly.

Cc: stable <stable@kernel.org>
Assisted-by: gkh_clanker_2000
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/2026022342-smokiness-stove-d792@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/uss720.c

index ec8bd968c4de5df05e2b087130eab733d3a37784..a8af7615b1bfb42154d02cd99b253755795608d0 100644 (file)
@@ -736,7 +736,7 @@ static int uss720_probe(struct usb_interface *intf,
        ret = get_1284_register(pp, 0, &reg, GFP_KERNEL);
        dev_dbg(&intf->dev, "reg: %7ph\n", priv->reg);
        if (ret < 0)
-               return ret;
+               goto probe_abort;
 
        ret = usb_find_last_int_in_endpoint(interface, &epd);
        if (!ret) {