]> www.infradead.org Git - users/jedix/linux-maple.git/commit
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)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:45:39 +0000 (15:45 -0700)
commit0fc790502490dc6b52796019ff142786724bd955
tree16a95b76e3d05e2ee8602ac38ae1b27b6e60456d
parent8e04742f31545d26ae5d88e4231f4aa88cf6cf69
can: gs_usb: fixed disconnect bug by removing erroneous use of kfree()

Orabug: stable_rc4

[ Upstream commit e9a2d81b1761093386a0bb8a4f51642ac785ef63 ]

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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit 01ff3a0a01366a231593476cfe775596ebdba30f)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
drivers/net/can/usb/gs_usb.c