aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-core.c')
-rw-r--r--drivers/hid/hid-core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 3da354af7a0a..44564f61e9cc 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1000,7 +1000,7 @@ int hid_open_report(struct hid_device *device)
1000 parser = vzalloc(sizeof(struct hid_parser)); 1000 parser = vzalloc(sizeof(struct hid_parser));
1001 if (!parser) { 1001 if (!parser) {
1002 ret = -ENOMEM; 1002 ret = -ENOMEM;
1003 goto err; 1003 goto alloc_err;
1004 } 1004 }
1005 1005
1006 parser->device = device; 1006 parser->device = device;
@@ -1039,6 +1039,7 @@ int hid_open_report(struct hid_device *device)
1039 hid_err(device, "unbalanced delimiter at end of report description\n"); 1039 hid_err(device, "unbalanced delimiter at end of report description\n");
1040 goto err; 1040 goto err;
1041 } 1041 }
1042 kfree(parser->collection_stack);
1042 vfree(parser); 1043 vfree(parser);
1043 device->status |= HID_STAT_PARSED; 1044 device->status |= HID_STAT_PARSED;
1044 return 0; 1045 return 0;
@@ -1047,6 +1048,8 @@ int hid_open_report(struct hid_device *device)
1047 1048
1048 hid_err(device, "item fetching failed at offset %d\n", (int)(end - start)); 1049 hid_err(device, "item fetching failed at offset %d\n", (int)(end - start));
1049err: 1050err:
1051 kfree(parser->collection_stack);
1052alloc_err:
1050 vfree(parser); 1053 vfree(parser);
1051 hid_close_report(device); 1054 hid_close_report(device);
1052 return ret; 1055 return ret;