提交 0f8fd43c 编写于 作者: D Dan Carpenter 提交者: Greg Kroah-Hartman

USB: gadget: midi: memory leak in f_midi_bind_config()

There is a small memory leak on the error paths.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 08895512
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册