public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.19 01/19] Input: synaptics-rmi4 - fail probing if memory allocation for "phys" fails
@ 2024-03-29 12:50 Sasha Levin
  2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 02/19] VMCI: Fix memcpy() run-time warning in dg_dispatch_as_host() Sasha Levin
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: Sasha Levin @ 2024-03-29 12:50 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Kunwu Chan, Dmitry Torokhov, Sasha Levin, minipli, linux-input

From: Kunwu Chan <chentao@kylinos.cn>

[ Upstream commit bc4996184d56cfaf56d3811ac2680c8a0e2af56e ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/input/rmi4/rmi_driver.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
index ac6a20f7afdfa..0da814b41e72b 100644
--- a/drivers/input/rmi4/rmi_driver.c
+++ b/drivers/input/rmi4/rmi_driver.c
@@ -1199,7 +1199,11 @@ static int rmi_driver_probe(struct device *dev)
 		}
 		rmi_driver_set_input_params(rmi_dev, data->input);
 		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);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2024-03-29 12:51 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-29 12:50 [PATCH AUTOSEL 4.19 01/19] Input: synaptics-rmi4 - fail probing if memory allocation for "phys" fails Sasha Levin
2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 02/19] VMCI: Fix memcpy() run-time warning in dg_dispatch_as_host() Sasha Levin
2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 03/19] sysv: don't call sb_bread() with pointers_lock held Sasha Levin
2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 04/19] scsi: lpfc: Fix possible memory leak in lpfc_rcv_padisc() Sasha Levin
2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 05/19] isofs: handle CDs with bad root inode but good Joliet root directory Sasha Levin
2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 06/19] arm64: dts: rockchip: fix rk3399 hdmi ports node Sasha Levin
2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 07/19] media: sta2x11: fix irq handler cast Sasha Levin
2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 08/19] drm/amd/display: Fix nanosec stat overflow Sasha Levin
2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 09/19] tools/power x86_energy_perf_policy: Fix file leak in get_pkg_num() Sasha Levin
2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 10/19] SUNRPC: increase size of rpc_wait_queue.qlen from unsigned short to unsigned int Sasha Levin
2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 11/19] sparc: vdso: Disable UBSAN instrumentation Sasha Levin
2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 12/19] PCI: Mark LSI FW643 to avoid bus reset Sasha Levin
2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 13/19] sh: Fix build with CONFIG_UBSAN=y Sasha Levin
2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 14/19] btrfs: handle chunk tree lookup error in btrfs_relocate_sys_chunks() Sasha Levin
2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 15/19] btrfs: export: handle invalid inode or root reference in btrfs_get_parent() Sasha Levin
2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 16/19] btrfs: send: handle path ref underflow in header iterate_inode_ref() Sasha Levin
2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 17/19] block: prevent division by zero in blk_rq_stat_sum() Sasha Levin
2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 18/19] Input: allocate keycode for Display refresh rate toggle Sasha Levin
2024-03-29 12:50 ` [PATCH AUTOSEL 4.19 19/19] ktest: force $buildonly = 1 for 'make_warnings_file' test type Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox