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

Commit ef2449ef authored by Kiran Gunda's avatar Kiran Gunda
Browse files

spmi: pmic-arb: Correct the peripheral mapping table size



spmi pmic arbiter V2 supports 256 peripherals. But the size
of the peripheral mapping table in the driver is defined
as 255, which leads to the buffer overflow. Fix it by correcting
the mapping table size to 256.

Change-Id: I88f1a01f28ad831811d3865b748beb1cba678c7d
Signed-off-by: default avatarKiran Gunda <kgunda@codeaurora.org>
parent d57440af
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -73,7 +73,7 @@ u32 pmic_arb_regs_v2[] = {
#define SPMI_MAPPING_BIT_IS_1_FLAG(X)	(((X) >> 8) & 0x1)
#define SPMI_MAPPING_BIT_IS_1_RESULT(X)	(((X) >> 0) & 0xFF)

#define SPMI_MAPPING_TABLE_LEN		255
#define SPMI_MAPPING_TABLE_LEN		256
#define SPMI_MAPPING_TABLE_TREE_DEPTH	16	/* Maximum of 16-bits */

/* Ownership Table */