提交 51b208dd 编写于 作者: O Oliver Neukum 提交者: Greg Kroah-Hartman

[PATCH] USB: kzalloc in usbvideo

another for kzalloc.
Signed-off-by: NOliver Neukum <oliver@neukum.name>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 b10b4177
......@@ -690,14 +690,13 @@ int usbvideo_register(
}
base_size = num_cams * sizeof(struct uvd) + sizeof(struct usbvideo);
cams = (struct usbvideo *) kmalloc(base_size, GFP_KERNEL);
cams = (struct usbvideo *) kzalloc(base_size, GFP_KERNEL);
if (cams == NULL) {
err("Failed to allocate %d. bytes for usbvideo struct", base_size);
return -ENOMEM;
}
dbg("%s: Allocated $%p (%d. bytes) for %d. cameras",
__FUNCTION__, cams, base_size, num_cams);
memset(cams, 0, base_size);
/* Copy callbacks, apply defaults for those that are not set */
memmove(&cams->cb, cbTbl, sizeof(cams->cb));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册