]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerSasha Levin <sasha.levin@oracle.com>
Fri, 18 Mar 2016 03:14:02 +0000 (23:14 -0400)
commit01ff3a0a01366a231593476cfe775596ebdba30f
tree5328151607d54ae94962cac955f63cffa14bba53
parent870be7d2ade42485fa40ac3d2ac8bcffa3afc957
can: gs_usb: fixed disconnect bug by removing erroneous use of kfree()

[ 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>
drivers/net/can/usb/gs_usb.c