提交 5c857eeb 编写于 作者: D Deepak Saxena 提交者: Linus Torvalds

[PATCH] drivers/cdrom: kmalloc + memset -> kzalloc conversion

Signed-off-by: NDeepak Saxena <dsaxena@plexity.net>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 3c76bc5b
...@@ -1085,7 +1085,7 @@ static int __init mcdx_init_drive(int drive) ...@@ -1085,7 +1085,7 @@ static int __init mcdx_init_drive(int drive)
xtrace(INIT, "kmalloc space for stuffpt's\n"); xtrace(INIT, "kmalloc space for stuffpt's\n");
xtrace(MALLOC, "init() malloc %d bytes\n", size); xtrace(MALLOC, "init() malloc %d bytes\n", size);
if (!(stuffp = kmalloc(size, GFP_KERNEL))) { if (!(stuffp = kzalloc(size, GFP_KERNEL))) {
xwarn("init() malloc failed\n"); xwarn("init() malloc failed\n");
return 1; return 1;
} }
...@@ -1101,8 +1101,6 @@ static int __init mcdx_init_drive(int drive) ...@@ -1101,8 +1101,6 @@ static int __init mcdx_init_drive(int drive)
sizeof(*stuffp), stuffp); sizeof(*stuffp), stuffp);
/* set default values */ /* set default values */
memset(stuffp, 0, sizeof(*stuffp));
stuffp->present = 0; /* this should be 0 already */ stuffp->present = 0; /* this should be 0 already */
stuffp->toc = NULL; /* this should be NULL already */ stuffp->toc = NULL; /* this should be NULL already */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册