Message ID | 2db59cee-8bb5-9b53-993b-c03fe5c58225@users.sourceforge.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index ffb7e5d4ee19..51f3547ca44f 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -131,8 +131,9 @@ static int open_collection(struct hid_parser *parser, unsigned type) } if (parser->device->maxcollection == parser->device->collection_size) { - collection = kmalloc(sizeof(struct hid_collection) * - parser->device->collection_size * 2, GFP_KERNEL); + collection = kmalloc_array(parser->device->collection_size * 2, + sizeof(*collection), + GFP_KERNEL); if (!collection) return -ENOMEM;