From: Johan Hovold <jhovold@gmail.com>
Date: Thu, 25 Oct 2012 08:29:01 +0000 (+0200)
Subject: USB: whiteheat: fix memory leak in error path
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c129197c99550d356cf5f69b046994dd53cd1b9d;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git

USB: whiteheat: fix memory leak in error path

Make sure command buffer is deallocated in case of errors during attach.

Cc: <support@connecttech.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---

diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index 346c7efc20b0..cfd155e2b6a2 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -333,6 +333,7 @@ no_firmware:
 		"%s: please contact support@connecttech.com\n",
 		serial->type->description);
 	kfree(result);
+	kfree(command);
 	return -ENODEV;
 
 no_command_private: