Commit bce1a784 authored by Pan Bian's avatar Pan Bian Committed by Dmitry Torokhov

Input: synaptics-rmi4 - fix possible double free

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: default avatarPan Bian <bianpan2016@163.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent f06eba72
...@@ -860,7 +860,7 @@ static int rmi_create_function(struct rmi_device *rmi_dev, ...@@ -860,7 +860,7 @@ static int rmi_create_function(struct rmi_device *rmi_dev,
error = rmi_register_function(fn); error = rmi_register_function(fn);
if (error) if (error)
goto err_put_fn; return error;
if (pdt->function_number == 0x01) if (pdt->function_number == 0x01)
data->f01_container = fn; data->f01_container = fn;
...@@ -870,10 +870,6 @@ static int rmi_create_function(struct rmi_device *rmi_dev, ...@@ -870,10 +870,6 @@ static int rmi_create_function(struct rmi_device *rmi_dev,
list_add_tail(&fn->node, &data->function_list); list_add_tail(&fn->node, &data->function_list);
return RMI_SCAN_CONTINUE; return RMI_SCAN_CONTINUE;
err_put_fn:
put_device(&fn->dev);
return error;
} }
void rmi_enable_irq(struct rmi_device *rmi_dev, bool clear_wake) void rmi_enable_irq(struct rmi_device *rmi_dev, bool clear_wake)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment