[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ce87c4bc-3a39-47a8-8860-9252960520b9@web.de>
Date: Wed, 21 Aug 2024 10:05:21 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Christophe Jaillet <christophe.jaillet@...adoo.fr>,
linux-input@...r.kernel.org
Cc: LKML <linux-kernel@...r.kernel.org>,
Benjamin Tissoires <bentiss@...nel.org>, Jiri Kosina <jikos@...nel.org>,
Stuart Hayhurst <stuart.a.hayhurst@...il.com>
Subject: Re: [v3] HID: corsair-void: Add Corsair Void headset family driver
>> +static ssize_t send_alert_store(struct device *dev,
>> + struct device_attribute *attr,
>> + const char *buf, size_t count)
>> +{
…
>> + unsigned char *send_buf __free(kfree) = NULL;
…
>> + send_buf = kmalloc(3, GFP_KERNEL);
…
>> + ret = hid_hw_raw_request(hid_dev, CORSAIR_VOID_NOTIF_REQUEST_ID,
>> + send_buf, 3, HID_OUTPUT_REPORT,
>> + HID_REQ_SET_REPORT);
…
> I'm not familiar with the hid_hw_raw_request() API, but I think that a kfree(send_buf) is missing here.
* Please take another look at the usage of scope-based resource management.
* Would you eventually prefer any other programming interfaces here?
Regards,
Markus
Powered by blists - more mailing lists