HID: hid-bigbenff: fix general protection fault caused by double kfree
authorHanno Zulla <kontakt@hanno.de>
Tue, 18 Feb 2020 11:37:47 +0000 (12:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Mar 2020 07:11:48 +0000 (08:11 +0100)
commit1bc271dd397d1f7a74ae4511019bf83f678f2960
tree91b7c0fa3fed43b3f8e42fe993ffa050630a3657
parent190e929e6cba5a9bcb7dd6c6f5acf8713d04c3c9
HID: hid-bigbenff: fix general protection fault caused by double kfree

[ Upstream commit 789a2c250340666220fa74bc6c8f58497e3863b3 ]

The struct *bigben was allocated via devm_kzalloc() and then used as a
parameter in input_ff_create_memless(). This caused a double kfree
during removal of the device, since both the managed resource API and
ml_ff_destroy() in drivers/input/ff-memless.c would call kfree() on it.

Signed-off-by: Hanno Zulla <kontakt@hanno.de>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-bigbenff.c