]> Pileus Git - ~andy/linux/blobdiff - drivers/hid/hid-input.c
HID: fix buffer allocations
[~andy/linux] / drivers / hid / hid-input.c
index d97f2323af573ecf229f9d76b536634c57c26e17..a713e6211419c880ddd0a39597b78f16ad84919a 100644 (file)
@@ -1178,7 +1178,7 @@ static void hidinput_led_worker(struct work_struct *work)
 
        /* fall back to generic raw-output-report */
        len = ((report->size - 1) >> 3) + 1 + (report->id > 0);
-       buf = kmalloc(len, GFP_KERNEL);
+       buf = hid_alloc_report_buf(report, GFP_KERNEL);
        if (!buf)
                return;
 
@@ -1279,7 +1279,7 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid)
        input_dev->id.vendor  = hid->vendor;
        input_dev->id.product = hid->product;
        input_dev->id.version = hid->version;
-       input_dev->dev.parent = hid->dev.parent;
+       input_dev->dev.parent = &hid->dev;
        hidinput->input = input_dev;
        list_add_tail(&hidinput->list, &hid->inputs);