]> git.baikalelectronics.ru Git - kernel.git/commit
spmi: pmic-arb: fix memory allocation for mapping_table
authorKiran Gunda <kgunda@codeaurora.org>
Fri, 28 Jul 2017 07:10:40 +0000 (12:40 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Aug 2017 11:51:19 +0000 (13:51 +0200)
commita7f80dd01bee9521a8babd72657c42d7a0b14cea
tree0432d396e1add31321aa1d720dc913c28a453978
parent79e602a4b1cc80c8d1eb2007d59f3cc670bb5172
spmi: pmic-arb: fix memory allocation for mapping_table

Allocate the correct memory size (max_pmic_peripherals) for the
mapping_table that holds the apid to ppid mapping. Also use a local
variable for mapping_table for better alignment of the code.

Fixes: 0d9fd55ac89b ("spmi: pmic-arb: Support more than 128 peripherals")
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spmi/spmi-pmic-arb.c