Input: rmi4 - initialize attn_fifo properly

attn_fifo is allocated as part of struct rmi_driver_data using
devm_kzalloc in rmi_driver_probe. However, it is never initialized.
A zero-initialized kfifo has its mask set to 0, which effectively
limits its capacity to 1 element instead of the declared 16.
This can lead to lost attention data and memory leaks of the attention
data payload if multiple attention events are received before the
threaded interrupt handler can process them.

Initialize attn_fifo using INIT_KFIFO after allocating rmi_driver_data.

Reported-by: sashiko-bot@kernel.org
Assisted-by: Antigravity:gemini-3.5-flash
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
Dmitry Torokhov 2026-06-10 18:28:33 -07:00
parent 2b4b482d5c
commit 6e752b35b6

View File

@ -1161,6 +1161,7 @@ static int rmi_driver_probe(struct device *dev)
return -ENOMEM;
INIT_LIST_HEAD(&data->function_list);
INIT_KFIFO(data->attn_fifo);
data->rmi_dev = rmi_dev;
dev_set_drvdata(&rmi_dev->dev, data);