Patch "staging: iio: resolver: ad2s1210: fix use before initialization" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

    staging: iio: resolver: ad2s1210: fix use before initialization

to the 6.1-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-resolver-ad2s1210-fix-use-before-initial.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit f746bdf0139c617436cc14b77bcf3ccd899c8879
Author: David Lechner <dlechner@xxxxxxxxxxxx>
Date:   Fri Sep 29 12:23:07 2023 -0500

    staging: iio: resolver: ad2s1210: fix use before initialization
    
    [ Upstream commit 7fe2d05cee46b1c4d9f1efaeab08cc31a0dfff60 ]
    
    This fixes a use before initialization in ad2s1210_probe(). The
    ad2s1210_setup_gpios() function uses st->sdev but it was being called
    before this field was initialized.
    
    Signed-off-by: David Lechner <dlechner@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230929-ad2s1210-mainline-v3-2-fa4364281745@xxxxxxxxxxxx
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c
index 636c45b128438..afe89c91c89ea 100644
--- a/drivers/staging/iio/resolver/ad2s1210.c
+++ b/drivers/staging/iio/resolver/ad2s1210.c
@@ -657,9 +657,6 @@ static int ad2s1210_probe(struct spi_device *spi)
 	if (!indio_dev)
 		return -ENOMEM;
 	st = iio_priv(indio_dev);
-	ret = ad2s1210_setup_gpios(st);
-	if (ret < 0)
-		return ret;
 
 	spi_set_drvdata(spi, indio_dev);
 
@@ -670,6 +667,10 @@ static int ad2s1210_probe(struct spi_device *spi)
 	st->resolution = 12;
 	st->fexcit = AD2S1210_DEF_EXCIT;
 
+	ret = ad2s1210_setup_gpios(st);
+	if (ret < 0)
+		return ret;
+
 	indio_dev->info = &ad2s1210_info;
 	indio_dev->modes = INDIO_DIRECT_MODE;
 	indio_dev->channels = ad2s1210_channels;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux