Skip to content

Commit

Permalink
can: gs_usb: fix memory leak in gs_cmd_reset()
Browse files Browse the repository at this point in the history
This patch adds the missing kfree() in gs_cmd_reset() to free the
memory that is not used anymore after usb_control_msg().

Cc: linux-stable <stable@vger.kernel.org>
Cc: Maximilian Schneider <max@schneidersoft.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
marckleinebudde committed Jun 9, 2017
1 parent dadcd39 commit 5cda3ee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/can/usb/gs_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ static int gs_cmd_reset(struct gs_usb *gsusb, struct gs_can *gsdev)
sizeof(*dm),
1000);

kfree(dm);

return rc;
}

Expand Down

0 comments on commit 5cda3ee

Please sign in to comment.