All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Nizam Haider <nizamhaider786@gmail.com>
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
Subject: Re: [PATCH] IIO: adc: at91_adc.c Prefer kmalloc_array over kmalloc with multiply
Date: Sun, 22 Nov 2015 12:06:40 +0000	[thread overview]
Message-ID: <5651AFD0.8060905@kernel.org> (raw)
In-Reply-To: <1447632357-8222-1-git-send-email-nizamhaider786@gmail.com>

On 16/11/15 00:05, Nizam Haider wrote:
> So this patch swaps that use out for kmalloc_array instead.
> 
> Signed-off-by Nizam Haider <nijamh@cdac.in>
Applied to the togreg branch of iio.git - initially push out as staging
Thanks,

Jonathan
> ---
>  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;
>  
> 


      reply	other threads:[~2015-11-22 12:06 UTC|newest]

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

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=5651AFD0.8060905@kernel.org \
    --to=jic23@kernel.org \
    --cc=alexandre.belloni@free-electrons.com \
    --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=nizamhaider786@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.