Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid

Pull input layer bugfix from Jiri Kosina:
"Memory leak regression fix from Benjamin Tissoires"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
HID: multitouch: prevent memleak with the allocated name

+7 -4
+7 -4
drivers/hid/hid-multitouch.c
··· 264 264 static void mt_free_input_name(struct hid_input *hi) 265 265 { 266 266 struct hid_device *hdev = hi->report->device; 267 + const char *name = hi->input->name; 267 268 268 - if (hi->input->name != hdev->name) 269 - kfree(hi->input->name); 269 + if (name != hdev->name) { 270 + hi->input->name = hdev->name; 271 + kfree(name); 272 + } 270 273 } 271 274 272 275 static ssize_t mt_show_quirks(struct device *dev, ··· 1043 1040 struct hid_input *hi; 1044 1041 1045 1042 sysfs_remove_group(&hdev->dev.kobj, &mt_attribute_group); 1046 - hid_hw_stop(hdev); 1047 - 1048 1043 list_for_each_entry(hi, &hdev->inputs, list) 1049 1044 mt_free_input_name(hi); 1045 + 1046 + hid_hw_stop(hdev); 1050 1047 1051 1048 kfree(td); 1052 1049 hid_set_drvdata(hdev, NULL);