]> git.baikalelectronics.ru Git - kernel.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)
committerJohan Hovold <johan@kernel.org>
Mon, 8 Aug 2016 11:41:17 +0000 (13:41 +0200)
commit80390a6db25d4404b78e22d9973437c54e4a6b05
tree62e8a15ea2e8180743bb43af45aedb0f6ed19693
parent610d22e2fd2ba7fe881824a8456c6f804421024a
USB: serial: fix memleak in driver-registration error path

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>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/usb-serial.c