Input: synaptics-rmi4 - fix possible double free
authorPan Bian <bianpan2016@163.com>
Fri, 19 Apr 2019 07:39:00 +0000 (07:39 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2019 17:41:25 +0000 (19:41 +0200)
commitafc7cebbbb5ed605fe76f44a3017613f2178ee0e
treeadee0fc0a84dfa8f7cb76a468a465878c86a4339
parentf621bc1bd7f440e1c6300665cfbe4d1caef46685
Input: synaptics-rmi4 - fix possible double free

[ Upstream commit bce1a78423961fce676ac65540a31b6ffd179e6d ]

The RMI4 function structure has been released in rmi_register_function
if error occurs. However, it will be released again in the function
rmi_create_function, which may result in a double-free bug.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/input/rmi4/rmi_driver.c