*/
#include <linux/acpi.h>
+#include <linux/cleanup.h>
#include <linux/dmi.h>
#include <linux/hid.h>
#include <linux/module.h>
static int asus_kbd_set_report(struct hid_device *hdev, const u8 *buf, size_t buf_size)
{
- unsigned char *dmabuf;
- int ret;
-
- dmabuf = kmemdup(buf, buf_size, GFP_KERNEL);
+ u8 *dmabuf __free(kfree) = kmemdup(buf, buf_size, GFP_KERNEL);
if (!dmabuf)
return -ENOMEM;
/*
* The report ID should be set from the incoming buffer due to LED and key
* interfaces having different pages
- */
- ret = hid_hw_raw_request(hdev, buf[0], dmabuf,
- buf_size, HID_FEATURE_REPORT,
- HID_REQ_SET_REPORT);
- kfree(dmabuf);
-
- return ret;
+ */
+ return hid_hw_raw_request(hdev, buf[0], dmabuf, buf_size, HID_FEATURE_REPORT,
+ HID_REQ_SET_REPORT);
}
static int asus_kbd_init(struct hid_device *hdev, u8 report_id)