提交 2e4fabec 编写于 作者: A Andrei Poenaru 提交者: Greg Kroah-Hartman

drivers: base: map: Use kmalloc_array instead of kmalloc

Reported by checkpatch.pl

While at it, removed blank line between function call and error
checking.
Signed-off-by: NAndrei Poenaru <andreigpoenaru@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 7036cd46
......@@ -41,8 +41,7 @@ int kobj_map(struct kobj_map *domain, dev_t dev, unsigned long range,
if (n > 255)
n = 255;
p = kmalloc(sizeof(struct probe) * n, GFP_KERNEL);
p = kmalloc_array(n, sizeof(struct probe), GFP_KERNEL);
if (p == NULL)
return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册