diff options
| -rw-r--r-- | drivers/hid/hid-multitouch.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index dc3ae5c56f56..d39a5cede0b0 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c | |||
| @@ -264,9 +264,12 @@ static struct mt_class mt_classes[] = { | |||
| 264 | static void mt_free_input_name(struct hid_input *hi) | 264 | static void mt_free_input_name(struct hid_input *hi) |
| 265 | { | 265 | { |
| 266 | struct hid_device *hdev = hi->report->device; | 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 | if (name != hdev->name) { |
| 269 | kfree(hi->input->name); | 270 | hi->input->name = hdev->name; |
| 271 | kfree(name); | ||
| 272 | } | ||
| 270 | } | 273 | } |
| 271 | 274 | ||
| 272 | static ssize_t mt_show_quirks(struct device *dev, | 275 | static ssize_t mt_show_quirks(struct device *dev, |
| @@ -1040,11 +1043,11 @@ static void mt_remove(struct hid_device *hdev) | |||
| 1040 | struct hid_input *hi; | 1043 | struct hid_input *hi; |
| 1041 | 1044 | ||
| 1042 | sysfs_remove_group(&hdev->dev.kobj, &mt_attribute_group); | 1045 | sysfs_remove_group(&hdev->dev.kobj, &mt_attribute_group); |
| 1043 | hid_hw_stop(hdev); | ||
| 1044 | |||
| 1045 | list_for_each_entry(hi, &hdev->inputs, list) | 1046 | list_for_each_entry(hi, &hdev->inputs, list) |
| 1046 | mt_free_input_name(hi); | 1047 | mt_free_input_name(hi); |
| 1047 | 1048 | ||
| 1049 | hid_hw_stop(hdev); | ||
| 1050 | |||
| 1048 | kfree(td); | 1051 | kfree(td); |
| 1049 | hid_set_drvdata(hdev, NULL); | 1052 | hid_set_drvdata(hdev, NULL); |
| 1050 | } | 1053 | } |
