All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio:buffer: Wrong sized allocation of demux table elements.
@ 2014-08-08  8:43 Jonathan Cameron
  2014-08-08  8:51 ` Lars-Peter Clausen
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2014-08-08  8:43 UTC (permalink / raw)
  To: linux-iio; +Cc: Jonathan Cameron, Lars-Peter Clausen

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>
Cc: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/iio/industrialio-buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index 84a952931f9f..ec82cb0bea38 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -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;
-- 
2.0.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-08 10:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-08  8:43 [PATCH] iio:buffer: Wrong sized allocation of demux table elements Jonathan Cameron
2014-08-08  8:51 ` Lars-Peter Clausen
2014-08-08 10:23   ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.