Commit b6573da1 authored by Benjamin Tissoires's avatar Benjamin Tissoires Committed by Dmitry Torokhov

Input: synaptics-rmi4 - prevent null pointer dereference in f30

If the platform data has f30_data.disable set, f30 in rmi_f30_config()
might be null. Prevent a kernel oops by checking for non-null f30.
Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 45838660
...@@ -170,6 +170,10 @@ static int rmi_f30_config(struct rmi_function *fn) ...@@ -170,6 +170,10 @@ static int rmi_f30_config(struct rmi_function *fn)
rmi_get_platform_data(fn->rmi_dev); rmi_get_platform_data(fn->rmi_dev);
int error; int error;
/* can happen if f30_data.disable is set */
if (!f30)
return 0;
if (pdata->f30_data.trackstick_buttons) { if (pdata->f30_data.trackstick_buttons) {
/* Try [re-]establish link to F03. */ /* Try [re-]establish link to F03. */
f30->f03 = rmi_find_function(fn->rmi_dev, 0x03); f30->f03 = rmi_find_function(fn->rmi_dev, 0x03);
......
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