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: Phani Kumar Uppalapati <phaniu@codeaurora.org>
This commit is contained in:
parent
a90169e004
commit
a1609b932e
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue