]> 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)
committerWilly Tarreau <w@1wt.eu>
Mon, 6 Feb 2017 22:33:06 +0000 (23:33 +0100)
commitdd33a40aabc430f7af56df753ec042494a8324ed
treea6e520f28f29b410d839a53c99b3efeadd399019
parent124253f7f54b772ea5178b2ec1d90f971a624bb0
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: Willy Tarreau <w@1wt.eu>
drivers/usb/serial/usb-serial.c