projects
/
GitHub
/
LineageOS
/
android_kernel_samsung_universal7580.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0889551
)
USB: gadget: midi: memory leak in f_midi_bind_config()
author
Dan Carpenter
<dan.carpenter@oracle.com>
Tue, 18 Oct 2011 06:25:34 +0000
(09:25 +0300)
committer
Greg Kroah-Hartman
<gregkh@suse.de>
Tue, 18 Oct 2011 20:51:35 +0000
(13:51 -0700)
There is a small memory leak on the error paths.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/f_midi.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/usb/gadget/f_midi.c
b/drivers/usb/gadget/f_midi.c
index ef1bc7a174efaf1b66f4d48720f25be1b02ac5b0..67b222908cf9fe264a3213b945f0beae5fa83569 100644
(file)
--- a/
drivers/usb/gadget/f_midi.c
+++ b/
drivers/usb/gadget/f_midi.c
@@
-951,7
+951,7
@@
int __init f_midi_bind_config(struct usb_configuration *c,
struct gmidi_in_port *port = kzalloc(sizeof(*port), GFP_KERNEL);
if (!port) {
status = -ENOMEM;
- goto fail;
+ goto
setup_
fail;
}
port->midi = midi;
@@
-989,6
+989,8
@@
int __init f_midi_bind_config(struct usb_configuration *c,
return 0;
setup_fail:
+ for (--i; i >= 0; i--)
+ kfree(midi->in_port[i]);
kfree(midi);
fail:
return status;