Patch "net: encx24j600: Add parentheses to fix precedence" has been added to the 4.9-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

    net: encx24j600: Add parentheses to fix precedence

to the 4.9-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:
     net-encx24j600-add-parentheses-to-fix-precedence.patch
and it can be found in the queue-4.9 subdirectory.

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



commit a27213bff5dfbb15825e4eabe7cbca1bd93e81ef
Author: Valentina Goncharenko <goncharenko.vp@xxxxxxxxx>
Date:   Thu Dec 1 20:34:07 2022 +0300

    net: encx24j600: Add parentheses to fix precedence
    
    [ Upstream commit 167b3f2dcc62c271f3555b33df17e361bb1fa0ee ]
    
    In functions regmap_encx24j600_phy_reg_read() and
    regmap_encx24j600_phy_reg_write() in the conditions of the waiting
    cycles for filling the variable 'ret' it is necessary to add parentheses
    to prevent wrong assignment due to logical operations precedence.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: d70e53262f5c ("net: Microchip encx24j600 driver")
    Signed-off-by: Valentina Goncharenko <goncharenko.vp@xxxxxxxxx>
    Reviewed-by: Pavan Chebbi <pavan.chebbi@xxxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/microchip/encx24j600-regmap.c b/drivers/net/ethernet/microchip/encx24j600-regmap.c
index b5de665ce718..44e656048c51 100644
--- a/drivers/net/ethernet/microchip/encx24j600-regmap.c
+++ b/drivers/net/ethernet/microchip/encx24j600-regmap.c
@@ -363,7 +363,7 @@ static int regmap_encx24j600_phy_reg_read(void *context, unsigned int reg,
 		goto err_out;
 
 	usleep_range(26, 100);
-	while ((ret = regmap_read(ctx->regmap, MISTAT, &mistat) != 0) &&
+	while (((ret = regmap_read(ctx->regmap, MISTAT, &mistat)) != 0) &&
 	       (mistat & BUSY))
 		cpu_relax();
 
@@ -401,7 +401,7 @@ static int regmap_encx24j600_phy_reg_write(void *context, unsigned int reg,
 		goto err_out;
 
 	usleep_range(26, 100);
-	while ((ret = regmap_read(ctx->regmap, MISTAT, &mistat) != 0) &&
+	while (((ret = regmap_read(ctx->regmap, MISTAT, &mistat)) != 0) &&
 	       (mistat & BUSY))
 		cpu_relax();
 



[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