From: Jonathan Cameron Date: Fri, 8 Aug 2014 08:43:00 +0000 (+0100) Subject: iio:buffer: Wrong sized allocation of demux table elements. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7cdca1784c6e1c9bacf053847676df53eec7b5ea;p=linux-beck.git 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: Jonathan Cameron Reported-by: kbuild@01.org Reported-by: Dan Carpenter Acked-by: Lars-Peter Clausen --- 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;