Commit bc499618 authored by Kunwu Chan's avatar Kunwu Chan Committed by Dmitry Torokhov

Input: synaptics-rmi4 - fail probing if memory allocation for "phys" fails

While input core can work with input->phys set to NULL userspace might
depend on it, so better fail probing if allocation fails. The system must
be in a pretty bad shape for it to happen anyway.
Signed-off-by: default avatarKunwu Chan <chentao@kylinos.cn>
Link: https://lore.kernel.org/r/20240117073124.143636-1-chentao@kylinos.cnSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent f0eb58dd
...@@ -1196,7 +1196,11 @@ static int rmi_driver_probe(struct device *dev) ...@@ -1196,7 +1196,11 @@ static int rmi_driver_probe(struct device *dev)
} }
rmi_driver_set_input_params(rmi_dev, data->input); rmi_driver_set_input_params(rmi_dev, data->input);
data->input->phys = devm_kasprintf(dev, GFP_KERNEL, data->input->phys = devm_kasprintf(dev, GFP_KERNEL,
"%s/input0", dev_name(dev)); "%s/input0", dev_name(dev));
if (!data->input->phys) {
retval = -ENOMEM;
goto err;
}
} }
retval = rmi_init_functions(data); retval = rmi_init_functions(data);
......
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