input: fix double kfree of device->rdesc on hid_parse_parse error

       path in hid-core.c
parent 90421068
...@@ -674,7 +674,6 @@ static struct hid_device *hid_parse_report(__u8 *start, unsigned size) ...@@ -674,7 +674,6 @@ static struct hid_device *hid_parse_report(__u8 *start, unsigned size)
if (item.format != HID_ITEM_FORMAT_SHORT) { if (item.format != HID_ITEM_FORMAT_SHORT) {
dbg("unexpected long global item"); dbg("unexpected long global item");
kfree(device->rdesc);
kfree(device->collection); kfree(device->collection);
hid_free_device(device); hid_free_device(device);
kfree(parser); kfree(parser);
...@@ -684,7 +683,6 @@ static struct hid_device *hid_parse_report(__u8 *start, unsigned size) ...@@ -684,7 +683,6 @@ static struct hid_device *hid_parse_report(__u8 *start, unsigned size)
if (dispatch_type[item.type](parser, &item)) { if (dispatch_type[item.type](parser, &item)) {
dbg("item %u %u %u %u parsing failed\n", dbg("item %u %u %u %u parsing failed\n",
item.format, (unsigned)item.size, (unsigned)item.type, (unsigned)item.tag); item.format, (unsigned)item.size, (unsigned)item.type, (unsigned)item.tag);
kfree(device->rdesc);
kfree(device->collection); kfree(device->collection);
hid_free_device(device); hid_free_device(device);
kfree(parser); kfree(parser);
...@@ -694,7 +692,6 @@ static struct hid_device *hid_parse_report(__u8 *start, unsigned size) ...@@ -694,7 +692,6 @@ static struct hid_device *hid_parse_report(__u8 *start, unsigned size)
if (start == end) { if (start == end) {
if (parser->collection_stack_ptr) { if (parser->collection_stack_ptr) {
dbg("unbalanced collection at end of report description"); dbg("unbalanced collection at end of report description");
kfree(device->rdesc);
kfree(device->collection); kfree(device->collection);
hid_free_device(device); hid_free_device(device);
kfree(parser); kfree(parser);
...@@ -702,7 +699,6 @@ static struct hid_device *hid_parse_report(__u8 *start, unsigned size) ...@@ -702,7 +699,6 @@ static struct hid_device *hid_parse_report(__u8 *start, unsigned size)
} }
if (parser->local.delimiter_depth) { if (parser->local.delimiter_depth) {
dbg("unbalanced delimiter at end of report description"); dbg("unbalanced delimiter at end of report description");
kfree(device->rdesc);
kfree(device->collection); kfree(device->collection);
hid_free_device(device); hid_free_device(device);
kfree(parser); kfree(parser);
...@@ -714,7 +710,6 @@ static struct hid_device *hid_parse_report(__u8 *start, unsigned size) ...@@ -714,7 +710,6 @@ static struct hid_device *hid_parse_report(__u8 *start, unsigned size)
} }
dbg("item fetching failed at offset %d\n", (int)(end - start)); dbg("item fetching failed at offset %d\n", (int)(end - start));
kfree(device->rdesc);
kfree(device->collection); kfree(device->collection);
hid_free_device(device); hid_free_device(device);
kfree(parser); kfree(parser);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment