mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 20:54:10 +08:00
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: Andrei Poenaru <andreigpoenaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7036cd46c8
commit
2e4fabec5e
@ -41,8 +41,7 @@ int kobj_map(struct kobj_map *domain, dev_t dev, unsigned long range,
|
|||||||
if (n > 255)
|
if (n > 255)
|
||||||
n = 255;
|
n = 255;
|
||||||
|
|
||||||
p = kmalloc(sizeof(struct probe) * n, GFP_KERNEL);
|
p = kmalloc_array(n, sizeof(struct probe), GFP_KERNEL);
|
||||||
|
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user