diff options
| author | Nicholas Troast <ntroast@codeaurora.org> | 2016-07-18 13:40:25 -0700 |
|---|---|---|
| committer | Nicholas Troast <ntroast@codeaurora.org> | 2016-07-18 13:44:59 -0700 |
| commit | adb003dad07c3b2eec5fa57fe7667f6e6270fd1c (patch) | |
| tree | eb3bcfdd1e0e958ec54956c6bc8bff3fe44d045d /drivers/power | |
| parent | 8665552e83e3d517f3ceae0efdc483735949af8d (diff) | |
qcom-charger: smb-lib: fix secure register writes
Currently the entire address is compared to a known secure boundary
offset leading to the address always being larger than the offset.
Mask the address such that only the offsets are compared.
Change-Id: I388d7f809f670c6db45b933d44d15168ae84f061
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Diffstat (limited to 'drivers/power')
| -rw-r--r-- | drivers/power/qcom-charger/smb-lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/qcom-charger/smb-lib.c b/drivers/power/qcom-charger/smb-lib.c index 55bcc9ec443e..b171096d4029 100644 --- a/drivers/power/qcom-charger/smb-lib.c +++ b/drivers/power/qcom-charger/smb-lib.c @@ -30,7 +30,7 @@ static bool is_secure(struct smb_charger *chg, int addr) { /* assume everything above 0xC0 is secure */ - return (bool)(addr >= 0xC0); + return (bool)((addr & 0xFF) >= 0xC0); } int smblib_read(struct smb_charger *chg, u16 addr, u8 *val) |
