summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHangyu Hua <hbh25y@gmail.com>2022-04-06 15:57:03 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-24 17:30:45 +0200
commitb67d19662fdee275c479d21853bc1239600a798f (patch)
tree2d990d743f9830e27bd7c0b4581933e788cb966b /drivers
parent88517757a829e9ce146a6c7233ad5dcdc66fcbb0 (diff)
downloadlinux-b67d19662fdee275c479d21853bc1239600a798f.tar.gz
linux-b67d19662fdee275c479d21853bc1239600a798f.tar.bz2
linux-b67d19662fdee275c479d21853bc1239600a798f.zip
char: xillybus: fix a refcount leak in cleanup_dev()
usb_get_dev is called in xillyusb_probe. So it is better to call usb_put_dev before xdev is released. Acked-by: Eli Billauer <eli.billauer@gmail.com> Signed-off-by: Hangyu Hua <hbh25y@gmail.com> Link: https://lore.kernel.org/r/20220406075703.23464-1-hbh25y@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/xillybus/xillyusb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/char/xillybus/xillyusb.c b/drivers/char/xillybus/xillyusb.c
index dc3551796e5e..39bcbfd908b4 100644
--- a/drivers/char/xillybus/xillyusb.c
+++ b/drivers/char/xillybus/xillyusb.c
@@ -549,6 +549,7 @@ static void cleanup_dev(struct kref *kref)
if (xdev->workq)
destroy_workqueue(xdev->workq);
+ usb_put_dev(xdev->udev);
kfree(xdev->channels); /* Argument may be NULL, and that's fine */
kfree(xdev);
}