Linux IIO development
 help / color / mirror / Atom feed
From: Nizam Haider <nizamhaider786@gmail.com>
To: jic23@kernel.org
Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
	leupold@rsi-elektrotechnik.de, nicolas.ferre@atmel.com,
	alexandre.belloni@free-electrons.com, octavian.purdila@intel.com,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Nizam Haider <nizamhaider786@gmail.com>
Subject: [PATCH] IIO: adc: at91_adc.c Prefer kmalloc_array over kmalloc with multiply
Date: Mon, 16 Nov 2015 05:35:57 +0530	[thread overview]
Message-ID: <1447632357-8222-1-git-send-email-nizamhaider786@gmail.com> (raw)

So this patch swaps that use out for kmalloc_array instead.

Signed-off-by Nizam Haider <nijamh@cdac.in>
---
 drivers/iio/adc/at91_adc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
index 7b40925..f284cd6 100644
--- a/drivers/iio/adc/at91_adc.c
+++ b/drivers/iio/adc/at91_adc.c
@@ -742,7 +742,7 @@ static int at91_adc_of_get_resolution(struct at91_adc_state *st,
 		return count;
 	}
 
-	resolutions = kmalloc(count * sizeof(*resolutions), GFP_KERNEL);
+	resolutions = kmalloc_array(count, sizeof(*resolutions), GFP_KERNEL);
 	if (!resolutions)
 		return -ENOMEM;
 
-- 
1.8.1.4

             reply	other threads:[~2015-11-16  0:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16  0:05 Nizam Haider [this message]
2015-11-22 12:06 ` [PATCH] IIO: adc: at91_adc.c Prefer kmalloc_array over kmalloc with multiply Jonathan Cameron

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=1447632357-8222-1-git-send-email-nizamhaider786@gmail.com \
    --to=nizamhaider786@gmail.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=leupold@rsi-elektrotechnik.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=octavian.purdila@intel.com \
    --cc=pmeerw@pmeerw.net \
    /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