Patch "hwmon: (tps23861) Fix reporting of negative temperatures" has been added to the 5.15-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

    hwmon: (tps23861) Fix reporting of negative temperatures

to the 5.15-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:
     hwmon-tps23861-fix-reporting-of-negative-temperature.patch
and it can be found in the queue-5.15 subdirectory.

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



commit 1f7e4cebe4cde99ab52268c017cd7e1e600b9fda
Author: Murad Masimov <m.masimov@xxxxxxxxx>
Date:   Thu Nov 21 20:36:03 2024 +0300

    hwmon: (tps23861) Fix reporting of negative temperatures
    
    [ Upstream commit de2bf507fabba9c0c678cf5ed54beb546f5ca29a ]
    
    Negative temperatures are reported as large positive temperatures
    due to missing sign extension from unsigned int to long. Cast unsigned
    raw register values to signed before performing the calculations
    to fix the problem.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: fff7b8ab2255 ("hwmon: add Texas Instruments TPS23861 driver")
    Signed-off-by: Murad Masimov <m.masimov@xxxxxxxxx>
    Message-ID: <20241121173604.2021-1-m.masimov@xxxxxxxxx>
    [groeck: Updated subject and description]
    Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/hwmon/tps23861.c b/drivers/hwmon/tps23861.c
index 2148fd543bb4b..3b2e72ed38c57 100644
--- a/drivers/hwmon/tps23861.c
+++ b/drivers/hwmon/tps23861.c
@@ -132,7 +132,7 @@ static int tps23861_read_temp(struct tps23861_data *data, long *val)
 	if (err < 0)
 		return err;
 
-	*val = (regval * TEMPERATURE_LSB) - 20000;
+	*val = ((long)regval * TEMPERATURE_LSB) - 20000;
 
 	return 0;
 }




[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