From: Andrei Poenaru Date: Sun, 8 Mar 2015 10:29:02 +0000 (+0200) Subject: drivers: base: map: Use kmalloc_array instead of kmalloc X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2e4fabec5e79d9fb8b75e4afda192ed3d6486f86;p=linux-beck.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/map.c b/drivers/base/map.c index e87017f36853..c1d38234d725 100644 --- a/drivers/base/map.c +++ b/drivers/base/map.c @@ -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;