mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02:00
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:
parent
2b4b482d5c
commit
6e752b35b6
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user