Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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: default avatar <kbuild@01.org>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
parent 145b0a5d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;