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

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

 



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

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