diff mbox

[2/6] hid: Use vzalloc for vmalloc/memset(,0...)

Message ID 049252dc8476fd9bad62ab7788b534ee5d1e6b18.1291951482.git.joe@perches.com (mailing list archive)
State Accepted
Headers show

Commit Message

Joe Perches Dec. 10, 2010, 3:29 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 2f410ae..ff43b4a 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -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;