usb: qcserial add missing errorpath kfrees
There are two -ENODEV error paths in qcprobe where the allocated private data is not freed, this patch adds the two missing kfrees to avoid leaking memory on the error path Signed-off-by: Steven Hardy <shardy@redhat.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
99ab3f9e4e
commit
cb62d65f96
|
@ -167,6 +167,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
|
||||||
"Could not set interface, error %d\n",
|
"Could not set interface, error %d\n",
|
||||||
retval);
|
retval);
|
||||||
retval = -ENODEV;
|
retval = -ENODEV;
|
||||||
|
kfree(data);
|
||||||
}
|
}
|
||||||
} else if (ifnum == 2) {
|
} else if (ifnum == 2) {
|
||||||
dbg("Modem port found");
|
dbg("Modem port found");
|
||||||
|
@ -191,6 +192,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
|
||||||
"Could not set interface, error %d\n",
|
"Could not set interface, error %d\n",
|
||||||
retval);
|
retval);
|
||||||
retval = -ENODEV;
|
retval = -ENODEV;
|
||||||
|
kfree(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue