summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2026-05-05 07:59:46 +0300
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2026-06-12 08:39:29 +0300
commit1ea51794d7e67f54ffe003bb04dd7e43107644d1 (patch)
tree22cee8428c1fc1743ceb758d4b0831e1d5352b7a
parentbcaea0fe87d521c044a3efc4ba3b78914072ed03 (diff)
downloadlinux-1ea51794d7e67f54ffe003bb04dd7e43107644d1.tar.xz
Input: rmi4 - use devm_kmalloc for F12 data packet buffer
The sensor->data_pkt buffer is used exclusively to store incoming hardware data during the attention handler, where it is entirely overwritten by either memcpy() or rmi_read_block(). Therefore, there is no need to zero-initialize it during probe. Switch to devm_kmalloc() to avoid the unnecessary memset overhead. Assisted-by: Gemini:gemini-3.1-pro Link: https://patch.msgid.link/20260505045952.1570713-16-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/rmi4/rmi_f12.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/rmi4/rmi_f12.c b/drivers/input/rmi4/rmi_f12.c
index b9cd70422b68..01838907c64b 100644
--- a/drivers/input/rmi4/rmi_f12.c
+++ b/drivers/input/rmi4/rmi_f12.c
@@ -452,7 +452,7 @@ static int rmi_f12_probe(struct rmi_function *fn)
rmi_dbg(RMI_DEBUG_FN, &fn->dev, "%s: data packet size: %u\n", __func__,
sensor->pkt_size);
- sensor->data_pkt = devm_kzalloc(&fn->dev, sensor->pkt_size, GFP_KERNEL);
+ sensor->data_pkt = devm_kmalloc(&fn->dev, sensor->pkt_size, GFP_KERNEL);
if (!sensor->data_pkt)
return -ENOMEM;