Commits
![Viresh Kumar](https://secure.gravatar.com/avatar/123ab10b8fc6f08826cd85b4cd86b86c.jpg?s=96&d=mm)
Viresh Kumar committed 8f5a37cb28f
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>