mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrei Poenaru <andreigpoenaru@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, Andrei Poenaru <andreigpoenaru@gmail.com>
Subject: [PATCH] drivers: base: map: Use kmalloc_array instead of kmalloc
Date: Sun,  8 Mar 2015 12:29:02 +0200	[thread overview]
Message-ID: <1425810542-5720-1-git-send-email-andreigpoenaru@gmail.com> (raw)

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


                 reply	other threads:[~2015-03-08 10:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425810542-5720-1-git-send-email-andreigpoenaru@gmail.com \
    --to=andreigpoenaru@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®