mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
Input: rmi4 - use kzalloc_flex() for struct rmi_function
struct rmi_function contains a flexible array member irq_mask. Convert the manual kzalloc size calculation to use the kzalloc_flex() macro. Assisted-by: Gemini:gemini-3.1-pro Link: https://patch.msgid.link/20260505045952.1570713-11-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
58d42ec10b
commit
f7e1920f6a
|
|
@ -242,9 +242,7 @@ struct rmi_function *rmi_alloc_function(struct rmi_device *rmi_dev, u8 id)
|
|||
struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev);
|
||||
struct rmi_function *fn;
|
||||
|
||||
fn = kzalloc(sizeof(*fn) +
|
||||
BITS_TO_LONGS(data->irq_count) * sizeof(unsigned long),
|
||||
GFP_KERNEL);
|
||||
fn = kzalloc_flex(*fn, irq_mask, BITS_TO_LONGS(data->irq_count));
|
||||
if (!fn)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user