linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Jonathan Cameron <jic23@kernel.org>, linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio:buffer: Wrong sized allocation of demux table elements.
Date: Fri, 08 Aug 2014 10:51:09 +0200	[thread overview]
Message-ID: <53E48F7D.5030402@metafoo.de> (raw)
In-Reply-To: <1407487392-1671-1-git-send-email-jic23@kernel.org>

On 08/08/2014 10:43 AM, Jonathan Cameron wrote:
> The size of the allocation is currently set to the size of the pointer
> rather than the structure we should actually be allocating.
>
> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
> Reported-by: kbuild@01.org
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Cc: Lars-Peter Clausen <lars@metafoo.de>

Ok, that answers the earlier question.

Thanks.

Acked-by: Lars-Peter Clausen <lars@metafoo.de>

> ---
>   drivers/iio/industrialio-buffer.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
> index 84a952931f9f..ec82cb0bea38 100644
> --- a/drivers/iio/industrialio-buffer.c
> +++ b/drivers/iio/industrialio-buffer.c
> @@ -951,7 +951,7 @@ static int iio_buffer_add_demux(struct iio_buffer *buffer,
>   		(*p)->to + (*p)->length == out_loc) {
>   		(*p)->length += length;
>   	} else {
> -		*p = kmalloc(sizeof(*p), GFP_KERNEL);
> +		*p = kmalloc(sizeof(**p), GFP_KERNEL);
>   		if (*p == NULL)
>   			return -ENOMEM;
>   		(*p)->from = in_loc;
>


  reply	other threads:[~2014-08-08  8:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-08  8:43 [PATCH] iio:buffer: Wrong sized allocation of demux table elements Jonathan Cameron
2014-08-08  8:51 ` Lars-Peter Clausen [this message]
2014-08-08 10:23   ` 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=53E48F7D.5030402@metafoo.de \
    --to=lars@metafoo.de \
    --cc=jic23@kernel.org \
    --cc=linux-iio@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;
as well as URLs for NNTP newsgroup(s).