Re: [v3] HID: corsair-void: Add Corsair Void headset family driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> +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




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux