mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 20:03:33 -04:00
pci: msm: Fix out of bound error with find_next_bit()
Existing api msm_pcie_write_reg_field() calls find_next_bit() and results in a KASAN out of bounds error for taking in the first parameter by typecasting as unsigned long type. To avoid the KASAN error use __ffs() instead. Change-Id: I9e155248e1233bbcb04ac5e2d1d6d512b3fa5387 Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
This commit is contained in:
parent
45e5597f7b
commit
b62866e622
1 changed files with 1 additions and 1 deletions
|
|
@ -1395,7 +1395,7 @@ static void msm_pcie_write_reg(void __iomem *base, u32 offset, u32 value)
|
|||
static void msm_pcie_write_reg_field(void __iomem *base, u32 offset,
|
||||
const u32 mask, u32 val)
|
||||
{
|
||||
u32 shift = find_first_bit((void *)&mask, 32);
|
||||
u32 shift = __ffs(mask);
|
||||
u32 tmp = readl_relaxed(base + offset);
|
||||
|
||||
tmp &= ~mask; /* clear written bits */
|
||||
|
|
|
|||
Loading…
Reference in a new issue