Commit 7cdca178 authored by Jonathan Cameron's avatar Jonathan Cameron

iio:buffer: Wrong sized allocation of demux table elements.

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: default avatarJonathan Cameron <jic23@kernel.org>
Reported-by: kbuild@01.org
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
parent 145b0a5d
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment