Title: [9360] trunk/drivers/staging/iio/adc/max1363_ring.c: merge from upstream: staging: iio: adc: max1363: prevent buffer overflow
Revision
9360
Author
vapier
Date
2010-10-24 16:51:39 -0400 (Sun, 24 Oct 2010)

Log Message

merge from upstream: staging: iio: adc: max1363: prevent buffer overflow

From: Michael Hennerich <[email protected]>

ring->access.read_last() reads the entire datum from
the ring including padding and time stamp.

Acked-by: Jonathan Cameron <[email protected]>
Signed-off-by: Michael Hennerich <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

Modified Paths

Diff

Modified: trunk/drivers/staging/iio/adc/max1363_ring.c (9359 => 9360)


--- trunk/drivers/staging/iio/adc/max1363_ring.c	2010-10-24 20:42:54 UTC (rev 9359)
+++ trunk/drivers/staging/iio/adc/max1363_ring.c	2010-10-24 20:51:39 UTC (rev 9360)
@@ -38,9 +38,8 @@
 		ret = -EBUSY;
 		goto error_ret;
 	}
-	numvals = hweight_long(st->current_mode->modemask);
 
-	ring_data = kmalloc(numvals*2, GFP_KERNEL);
+	ring_data = kmalloc(ring->access.get_bytes_per_datum(ring), GFP_KERNEL);
 	if (ring_data == NULL) {
 		ret = -ENOMEM;
 		goto error_ret;
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to