Skip to contentSkip to conversation

Patch "staging: iio: ad7192: Fix - use the dedicated reset function avoiding dma from stack." has been added to the 3.18-stable tree

PATCH [email protected] 1 participant 1 message Oct 9, 2017

Subsystems (5)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

staging: iio: ad7192: Fix - use the dedicated reset function avoiding dma from stack.

to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
staging-iio-ad7192-fix-use-the-dedicated-reset-function-avoiding-dma-from-stack.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From f790923f146140a261ad211e5baf75d169f16fb2 Mon Sep 17 00:00:00 2001

From: Stefan Popa <[email protected]>
Date: Thu, 14 Sep 2017 16:50:28 +0300
Subject: staging: iio: ad7192: Fix - use the dedicated reset function avoiding dma from stack.

From: Stefan Popa <[email protected]>

commit f790923f146140a261ad211e5baf75d169f16fb2 upstream.

Depends on: 691c4b95d1 ("iio: ad_sigma_delta: Implement a dedicated reset function")

SPI host drivers can use DMA to transfer data, so the buffer should be properly allocated. Keeping it on the stack could cause an undefined behavior.

The dedicated reset function solves this issue.

---
 drivers/staging/iio/adc/ad7192.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/iio/adc/ad7192.c +1 -3
@@ -206,11 +206,9 @@ static int ad7192_setup(struct ad7192_st
 	struct iio_dev *indio_dev = spi_get_drvdata(st->sd.spi);
 	unsigned long long scale_uv;
 	int i, ret, id;
-	u8 ones[6];
 
 	/* reset the serial interface */
-	memset(&ones, 0xFF, 6);
-	ret = spi_write(st->sd.spi, &ones, 6);
+	ret = ad_sd_reset(&st->sd, 48);
 	if (ret < 0)
 		goto out;
 	usleep_range(500, 1000); /* Wait for at least 500us */

Patches currently in stable-queue which might be from [email protected] are

queue-3.18/staging-iio-ad7192-fix-use-the-dedicated-reset-function-avoiding-dma-from-stack.patch