can: gs_usb: fixed disconnect bug by removing erroneous use of kfree()
authorMaximilain Schneider <max@schneidersoft.net>
Tue, 23 Feb 2016 01:17:28 +0000 (01:17 +0000)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 26 Feb 2016 07:36:33 +0000 (08:36 +0100)
commite9a2d81b1761093386a0bb8a4f51642ac785ef63
treefc98a26a18092acc4d2086fe0116accd10aa85a5
parent4c0b6eaf373a5323f03a3a20c42fc435715b073d
can: gs_usb: fixed disconnect bug by removing erroneous use of kfree()

gs_destroy_candev() erroneously calls kfree() on a struct gs_can *, which is
allocated through alloc_candev() and should instead be freed using
free_candev() alone.

The inappropriate use of kfree() causes the kernel to hang when
gs_destroy_candev() is called.

Only the struct gs_usb * which is allocated through kzalloc() should be freed
using kfree() when the device is disconnected.

Signed-off-by: Maximilian Schneider <max@schneidersoft.net>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/gs_usb.c