Patch "i2c: imx-lpi2c: fix type char overflow issue when calculating the clock cycle" has been added to the 5.4-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

    i2c: imx-lpi2c: fix type char overflow issue when calculating the clock cycle

to the 5.4-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:
     i2c-imx-lpi2c-fix-type-char-overflow-issue-when-calc.patch
and it can be found in the queue-5.4 subdirectory.

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



commit 0c79dc49844ff9af0a67bdce05ba31da5b214f44
Author: Clark Wang <xiaoning.wang@xxxxxxx>
Date:   Mon May 29 16:02:51 2023 +0800

    i2c: imx-lpi2c: fix type char overflow issue when calculating the clock cycle
    
    [ Upstream commit e69b9bc170c6d93ee375a5cbfd15f74c0fb59bdd ]
    
    Claim clkhi and clklo as integer type to avoid possible calculation
    errors caused by data overflow.
    
    Fixes: a55fa9d0e42e ("i2c: imx-lpi2c: add low power i2c bus driver")
    Signed-off-by: Clark Wang <xiaoning.wang@xxxxxxx>
    Signed-off-by: Carlos Song <carlos.song@xxxxxxx>
    Reviewed-by: Andi Shyti <andi.shyti@xxxxxxxxxx>
    Signed-off-by: Wolfram Sang <wsa@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
index 4fac2591b6618..89faef6f013b4 100644
--- a/drivers/i2c/busses/i2c-imx-lpi2c.c
+++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
@@ -206,8 +206,8 @@ static void lpi2c_imx_stop(struct lpi2c_imx_struct *lpi2c_imx)
 /* CLKLO = I2C_CLK_RATIO * CLKHI, SETHOLD = CLKHI, DATAVD = CLKHI/2 */
 static int lpi2c_imx_config(struct lpi2c_imx_struct *lpi2c_imx)
 {
-	u8 prescale, filt, sethold, clkhi, clklo, datavd;
-	unsigned int clk_rate, clk_cycle;
+	u8 prescale, filt, sethold, datavd;
+	unsigned int clk_rate, clk_cycle, clkhi, clklo;
 	enum lpi2c_imx_pincfg pincfg;
 	unsigned int temp;
 



[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