Skip to content

Commit

Permalink
USB: whiteheat: fix memory leak in error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Oct 25, 2012
1 parent 2ee44fb commit c129197
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/serial/whiteheat.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ static int whiteheat_attach(struct usb_serial *serial)
"%s: please contact support@connecttech.com\n",
serial->type->description);
kfree(result);
kfree(command);
return -ENODEV;

no_command_private:
Expand Down

0 comments on commit c129197

Please sign in to comment.