projects
/
platform
/
kernel
/
linux-starfive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
usb: gadget: f_hid: fix refcount leak on error path
[platform/kernel/linux-starfive.git]
/
drivers
/
usb
/
gadget
/
function
/
f_hid.c
diff --git
a/drivers/usb/gadget/function/f_hid.c
b/drivers/usb/gadget/function/f_hid.c
index
8b8bbea
..
6be6009
100644
(file)
--- a/
drivers/usb/gadget/function/f_hid.c
+++ b/
drivers/usb/gadget/function/f_hid.c
@@
-1292,6
+1292,7
@@
static struct usb_function *hidg_alloc(struct usb_function_instance *fi)
GFP_KERNEL);
if (!hidg->report_desc) {
put_device(&hidg->dev);
+ --opts->refcnt;
mutex_unlock(&opts->lock);
return ERR_PTR(-ENOMEM);
}