public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IIO: adc: at91_adc.c Prefer kmalloc_array over kmalloc with multiply
@ 2015-11-16  0:05 Nizam Haider
  2015-11-22 12:06 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Nizam Haider @ 2015-11-16  0:05 UTC (permalink / raw)
  To: jic23
  Cc: knaack.h, lars, pmeerw, leupold, nicolas.ferre, alexandre.belloni,
	octavian.purdila, linux-iio, linux-kernel, Nizam Haider

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] IIO: adc: at91_adc.c Prefer kmalloc_array over kmalloc with multiply
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2015-11-22 12:06 UTC (permalink / raw)
  To: Nizam Haider
  Cc: knaack.h, lars, pmeerw, leupold, nicolas.ferre, alexandre.belloni,
	octavian.purdila, linux-iio, linux-kernel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-22 12:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox