Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 100cac6e authored by Phani Kumar Uppalapati's avatar Phani Kumar Uppalapati
Browse files

drivers: mfd: Avoid wcd9335 invalid register access



wcd9335 codec does not have registers from address
0xE00, but due to erroneous condition check, even
registers above 0xE00 are accessed in the driver.
Update condition so as to prevent the invalid register
access.

Change-Id: Iad3d1e72543c018ae102165f54b8a58f35994923
Signed-off-by: default avatarPhani Kumar Uppalapati <phaniu@codeaurora.org>
parent 84bfeac2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1300,6 +1300,8 @@ static bool wcd9335_is_readable_register(struct device *dev, unsigned int reg)
	pg_num = reg >> 0x8;
	if (pg_num == 0x80)
		pg_num = PAGE_0X80;
	else if (pg_num >= 0xE)
		return false;

	reg_tbl = wcd9335_reg[pg_num];
	reg_offset = reg & 0xFF;