mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
thermal: intel: int340x: Fix potential shift overflow in ptc_mmio_write()
The value parameter is u32 but is shifted into a u64 register value without casting first. If the shift amount pushes bits beyond 32, they are lost. Cast value to u64 before shifting to ensure all bits are preserved. Signed-off-by: Aravind Anilraj <aravindanilraj0702@gmail.com> Link: https://patch.msgid.link/20260329070642.10721-2-aravindanilraj0702@gmail.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
committed by
Rafael J. Wysocki
parent
e7ae89a0c9
commit
1fac728735
@@ -138,7 +138,7 @@ static void ptc_mmio_write(struct pci_dev *pdev, u32 offset, int index, u32 valu
|
||||
|
||||
reg_val = readq((void __iomem *) (proc_priv->mmio_base + offset));
|
||||
reg_val &= ~mask;
|
||||
reg_val |= (value << ptc_mmio_regs[index].shift);
|
||||
reg_val |= ((u64)value << ptc_mmio_regs[index].shift);
|
||||
writeq(reg_val, (void __iomem *) (proc_priv->mmio_base + offset));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user