linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] iio: inkern: clear allocated memory
@ 2012-09-10  8:02 Kim, Milo
  2012-09-10  9:12 ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Kim, Milo @ 2012-09-10  8:02 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Jonathan Cameron, Lars-Peter Clausen, linux-iio, linux-kernel

 Use kzalloc() rathern than kmalloc() for initializing iio_dev and
 iio_chan_spec.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
---
 drivers/iio/inkern.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
index b5afc2f..1faa240 100644
--- a/drivers/iio/inkern.c
+++ b/drivers/iio/inkern.c
@@ -130,7 +130,7 @@ struct iio_channel *iio_channel_get(const char *name, const char *channel_name)
 	if (c == NULL)
 		return ERR_PTR(-ENODEV);
 
-	channel = kmalloc(sizeof(*channel), GFP_KERNEL);
+	channel = kzalloc(sizeof(*channel), GFP_KERNEL);
 	if (channel == NULL)
 		return ERR_PTR(-ENOMEM);
 
-- 
1.7.9.5


Best Regards,
Milo



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

* Re: [PATCH 1/2] iio: inkern: clear allocated memory
  2012-09-10  8:02 [PATCH 1/2] iio: inkern: clear allocated memory Kim, Milo
@ 2012-09-10  9:12 ` Jonathan Cameron
  2012-09-14  1:27   ` Kim, Milo
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2012-09-10  9:12 UTC (permalink / raw)
  To: Kim, Milo
  Cc: Jonathan Cameron, Jonathan Cameron, Lars-Peter Clausen,
	linux-iio, linux-kernel

On 10/09/12 09:02, Kim, Milo wrote:
>   Use kzalloc() rathern than kmalloc() for initializing iio_dev and
>   iio_chan_spec.
Please state why.  I'm sure I can track it down, but it ought to be
in the commit comment.
>
> Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
> ---
>   drivers/iio/inkern.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
> index b5afc2f..1faa240 100644
> --- a/drivers/iio/inkern.c
> +++ b/drivers/iio/inkern.c
> @@ -130,7 +130,7 @@ struct iio_channel *iio_channel_get(const char *name, const char *channel_name)
>   	if (c == NULL)
>   		return ERR_PTR(-ENODEV);
>
> -	channel = kmalloc(sizeof(*channel), GFP_KERNEL);
> +	channel = kzalloc(sizeof(*channel), GFP_KERNEL);
>   	if (channel == NULL)
>   		return ERR_PTR(-ENOMEM);
>
>


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

* RE: [PATCH 1/2] iio: inkern: clear allocated memory
  2012-09-10  9:12 ` Jonathan Cameron
@ 2012-09-14  1:27   ` Kim, Milo
  0 siblings, 0 replies; 3+ messages in thread
From: Kim, Milo @ 2012-09-14  1:27 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Jonathan Cameron, Jonathan Cameron, Lars-Peter Clausen,
	linux-iio, linux-kernel

> Please state why.  I'm sure I can track it down, but it ought to be
> in the commit comment.

The patch was resent with more detailed description.
Title : [PATCH RESEND] iio: inkern: allocate zeroed memory

Thanks for your comment.

Best Regards,
Milo


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

end of thread, other threads:[~2012-09-14  1:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-10  8:02 [PATCH 1/2] iio: inkern: clear allocated memory Kim, Milo
2012-09-10  9:12 ` Jonathan Cameron
2012-09-14  1:27   ` Kim, Milo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).