Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Kunwu Chan <chentao@kylinos.cn>
Link: https://lore.kernel.org/r/20240117073124.143636-1-chentao@kylinos.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Kunwu Chan and committed by
Dmitry Torokhov
bc499618 f0eb58dd

+5 -1
+5 -1
drivers/input/rmi4/rmi_driver.c
··· 1196 1196 } 1197 1197 rmi_driver_set_input_params(rmi_dev, data->input); 1198 1198 data->input->phys = devm_kasprintf(dev, GFP_KERNEL, 1199 - "%s/input0", dev_name(dev)); 1199 + "%s/input0", dev_name(dev)); 1200 + if (!data->input->phys) { 1201 + retval = -ENOMEM; 1202 + goto err; 1203 + } 1200 1204 } 1201 1205 1202 1206 retval = rmi_init_functions(data);