Patch "gpio: pca953x: avoid to use uninitialized value pinctrl" 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

    gpio: pca953x: avoid to use uninitialized value pinctrl

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:
     gpio-pca953x-avoid-to-use-uninitialized-value-pinctr.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 97cff9a623d521908d0c7b8fb337bbf764b02e13
Author: Haibo Chen <haibo.chen@xxxxxxx>
Date:   Sun Dec 11 00:05:58 2022 +0200

    gpio: pca953x: avoid to use uninitialized value pinctrl
    
    [ Upstream commit 90fee3dd5bfc1b9f4c8c0ba6cd2a35c9d79ca4de ]
    
    There is a variable pinctrl declared without initializer. And then
    has the case (switch operation chose the default case) to directly
    use this uninitialized value, this is not a safe behavior. So here
    initialize the pinctrl as 0 to avoid this issue.
    This is reported by Coverity.
    
    Fixes: 13c5d4ce8060 ("gpio: pca953x: Add support for PCAL6534")
    Signed-off-by: Haibo Chen <haibo.chen@xxxxxxx>
    Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
    Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index ebe1943b85dd..bf21803a0036 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -473,6 +473,9 @@ static u8 pcal6534_recalc_addr(struct pca953x_chip *chip, int reg, int off)
 	case PCAL6524_DEBOUNCE:
 		pinctrl = ((reg & PCAL_PINCTRL_MASK) >> 1) + 0x1c;
 		break;
+	default:
+		pinctrl = 0;
+		break;
 	}
 
 	return pinctrl + addr + (off / BANK_SZ);



[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