mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drivers: base: map: Use kmalloc_array instead of kmalloc
@ 2015-03-08 10:29 Andrei Poenaru
  0 siblings, 0 replies; only message in thread
From: Andrei Poenaru @ 2015-03-08 10:29 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Andrei Poenaru

Reported by checkpatch.pl

While at it, removed blank line between function call and error
checking.

Signed-off-by: Andrei Poenaru <andreigpoenaru@gmail.com>
---
 drivers/base/map.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/base/map.c b/drivers/base/map.c
index e87017f..c1d3823 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;
 
-- 
1.9.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-08 10:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-08 10:29 [PATCH] drivers: base: map: Use kmalloc_array instead of kmalloc Andrei Poenaru

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®