diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-09-04 17:31:22 +0530 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2014-09-16 11:01:26 +0200 |
commit | 8f5a37cb28fce189f3d6802ade98a116f59a47bf (patch) | |
tree | eb56816582ed39027d27a517012b4cc67e4ffcdd /drivers/power/pda_power.c | |
parent | 86515b7de86443775cf5e821e52df4c0adf528ab (diff) | |
download | op-kernel-dev-8f5a37cb28fce189f3d6802ade98a116f59a47bf.zip op-kernel-dev-8f5a37cb28fce189f3d6802ade98a116f59a47bf.tar.gz |
power-supply: Don't over-allocate memory for "supplied-from" array
In routine power_supply_check_supplies(), 'cnt' is counting the number of
supplies passed in "power-supplies" field of a node. The value of 'cnt' will
always be one more than the number of supplies after the do-while loop ends. And
so we need to allocate memory for 'cnt - 1' char pointers. But we are allocating
memory for 'cnt' instead.
Fix this by not over-allocating memory.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power/pda_power.c')
0 files changed, 0 insertions, 0 deletions