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:42:25 +0000 (19:42 +0200)
commitb77b0e6b07013819cffb5880f127c67554419804
tree601254ee651bf562edcdce3270c868d5b78bba16
parente703f958bea9870f2e85f8514643db322aa0b398
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