iio:buffer: Wrong sized allocation of demux table elements.
authorJonathan Cameron <jic23@kernel.org>
Fri, 8 Aug 2014 08:43:00 +0000 (09:43 +0100)
committerJonathan Cameron <jic23@kernel.org>
Fri, 8 Aug 2014 10:22:06 +0000 (11:22 +0100)
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>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
drivers/iio/industrialio-buffer.c

index 84a952931f9f840688718c942401f5a06e08195a..ec82cb0bea383558db49cf1ae71eaeb6c0260bf3 100644 (file)
@@ -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;