]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
USB: serial: fix memleak in driver-registration error path
authorAlexey Klimov <klimov.linux@gmail.com>
Mon, 8 Aug 2016 01:34:46 +0000 (02:34 +0100)
committerJiri Slaby <jslaby@suse.cz>
Wed, 21 Sep 2016 11:40:08 +0000 (13:40 +0200)
commit4f5e6d558d6bdb5d0206e8f7cbf737d07ca61d38
treeb03e2420f4a26df2e8a0112f9e309948677ba639
parenta0e3daf77a3cc07d93b0fd6257dbf51a6e3016bf
USB: serial: fix memleak in driver-registration error path

commit 647024a7df36014bbc4479d92d88e6b77c0afcf6 upstream.

udriver struct allocated by kzalloc() will not be freed
if usb_register() and next calls fail. This patch fixes this
by adding one more step with kfree(udriver) in error path.

Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/usb/serial/usb-serial.c