Patch "drm/i915/hwmon: Fix static analysis tool reported issues" has been added to the 6.6-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

    drm/i915/hwmon: Fix static analysis tool reported issues

to the 6.6-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:
     drm-i915-hwmon-fix-static-analysis-tool-reported-iss.patch
and it can be found in the queue-6.6 subdirectory.

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



commit 8b257a0cd35610b6c1cfbe00fe863706e4471c1e
Author: Karthik Poosa <karthik.poosa@xxxxxxxxx>
Date:   Mon Dec 4 20:18:09 2023 +0530

    drm/i915/hwmon: Fix static analysis tool reported issues
    
    [ Upstream commit 768f17fd25e4a98bf5166148629ecf6f647d5efc ]
    
    Updated i915 hwmon with fixes for issues reported by static analysis tool.
    Fixed integer overflow with upcasting.
    
    v2:
    - Added Fixes tag (Badal).
    - Updated commit message as per review comments (Anshuman).
    
    Fixes: 4c2572fe0ae7 ("drm/i915/hwmon: Expose power1_max_interval")
    Reviewed-by: Badal Nilawar <badal.nilawar@xxxxxxxxx>
    Reviewed-by: Anshuman Gupta <anshuman.gupta@xxxxxxxxx>
    Signed-off-by: Karthik Poosa <karthik.poosa@xxxxxxxxx>
    Signed-off-by: Anshuman Gupta <anshuman.gupta@xxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20231204144809.1518704-1-karthik.poosa@xxxxxxxxx
    (cherry picked from commit ac3420d3d428443a08b923f9118121c170192b62)
    Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/i915/i915_hwmon.c b/drivers/gpu/drm/i915/i915_hwmon.c
index 975da8e7f2a9f..8c3f443c8347e 100644
--- a/drivers/gpu/drm/i915/i915_hwmon.c
+++ b/drivers/gpu/drm/i915/i915_hwmon.c
@@ -175,7 +175,7 @@ hwm_power1_max_interval_show(struct device *dev, struct device_attribute *attr,
 	 *     tau4 = (4 | x) << y
 	 * but add 2 when doing the final right shift to account for units
 	 */
-	tau4 = ((1 << x_w) | x) << y;
+	tau4 = (u64)((1 << x_w) | x) << y;
 	/* val in hwmon interface units (millisec) */
 	out = mul_u64_u32_shr(tau4, SF_TIME, hwmon->scl_shift_time + x_w);
 
@@ -211,7 +211,7 @@ hwm_power1_max_interval_store(struct device *dev,
 	r = FIELD_PREP(PKG_MAX_WIN, PKG_MAX_WIN_DEFAULT);
 	x = REG_FIELD_GET(PKG_MAX_WIN_X, r);
 	y = REG_FIELD_GET(PKG_MAX_WIN_Y, r);
-	tau4 = ((1 << x_w) | x) << y;
+	tau4 = (u64)((1 << x_w) | x) << y;
 	max_win = mul_u64_u32_shr(tau4, SF_TIME, hwmon->scl_shift_time + x_w);
 
 	if (val > max_win)




[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