linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>, linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio:buffer: Wrong sized allocation of demux table elements.
Date: Fri, 08 Aug 2014 11:23:56 +0100	[thread overview]
Message-ID: <53E4A53C.8090907@kernel.org> (raw)
In-Reply-To: <53E48F7D.5030402@metafoo.de>

On 08/08/14 09:51, Lars-Peter Clausen wrote:
> 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>
Applied to the togreg branch of iio.git and pushed out as testing...

Thanks,
>
>> ---
>>   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;
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


      reply	other threads:[~2014-08-08 10:24 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
2014-08-08 10:23   ` 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=53E4A53C.8090907@kernel.org \
    --to=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --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).