USB: serial: fix memleak in driver-registration error path

[ Upstream commit 647024a7df ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
This commit is contained in:
Alexey Klimov 2016-08-08 02:34:46 +01:00 • committed by Sasha Levin
commit 8b0f82fcce