Skip to content

Commit

Permalink
HID: Use vzalloc for vmalloc/memset(,0...)
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Joe Perches authored and Jiri Kosina committed Dec 10, 2010
1 parent 4291ee3 commit fe25802
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,13 +654,12 @@ int hid_parse_report(struct hid_device *device, __u8 *start,
return -ENOMEM;
device->rsize = size;

parser = vmalloc(sizeof(struct hid_parser));
parser = vzalloc(sizeof(struct hid_parser));
if (!parser) {
ret = -ENOMEM;
goto err;
}

memset(parser, 0, sizeof(struct hid_parser));
parser->device = device;

end = start + size;
Expand Down

0 comments on commit fe25802

Please sign in to comment.