提交 7cdca178 编写于 作者: J 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: NJonathan Cameron <jic23@kernel.org>
Reported-by: kbuild@01.org
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NLars-Peter Clausen <lars@metafoo.de>
上级 145b0a5d
...@@ -951,7 +951,7 @@ static int iio_buffer_add_demux(struct iio_buffer *buffer, ...@@ -951,7 +951,7 @@ static int iio_buffer_add_demux(struct iio_buffer *buffer,
(*p)->to + (*p)->length == out_loc) { (*p)->to + (*p)->length == out_loc) {
(*p)->length += length; (*p)->length += length;
} else { } else {
*p = kmalloc(sizeof(*p), GFP_KERNEL); *p = kmalloc(sizeof(**p), GFP_KERNEL);
if (*p == NULL) if (*p == NULL)
return -ENOMEM; return -ENOMEM;
(*p)->from = in_loc; (*p)->from = in_loc;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册