iio:buffer: Wrong sized allocation of demux table elements.
Jonathan Cameron
maintainerPATCH 1/1 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.
--- drivers/iio/industrialio-buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/industrialio-buffer.c +1 -1
@@ -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;
Signature · 1 line
2.0.3
Quoted 7 lines · Jonathan Cameron
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 <[email protected]>Reported-by [email protected]Reported-by Dan Carpenter <[email protected]>Cc Lars-Peter Clausen <[email protected]>
Ok, that answers the earlier question.
Thanks.
Quoted 18 lines
--- drivers/iio/industrialio-buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/industrialio-buffer.c +1
-1@@ -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;
Jonathan Cameron
maintainerQuoted 9 lines · Lars-Peter Clausen
Quoted 7 lines · Jonathan Cameron
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 <[email protected]>Reported-by [email protected]Reported-by Dan Carpenter <[email protected]>Cc Lars-Peter Clausen <[email protected]>
Quoted 5 lines
Ok, that answers the earlier question.
Thanks.
Applied to the togreg branch of iio.git and pushed out as testing...
Thanks,
Quoted 24 lines
Quoted 11 lines
--- drivers/iio/industrialio-buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/industrialio-buffer.c +0
-0drivers/iio/industrialio-buffer.c static int iio_buffer_add_demux(struct iio_buffer *buffer, · line 957
Quoted 8 lines
drivers/iio/industrialio-buffer.c +1
-1@@ -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;--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html