Re: [PATCH] iio:buffer: Wrong sized allocation of demux table elements.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
Reported-by: kbuild@xxxxxx
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Cc: Lars-Peter Clausen <lars@xxxxxxxxxx>

Ok, that answers the earlier question.

Thanks.

Acked-by: Lars-Peter Clausen <lars@xxxxxxxxxx>
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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux