From: Viresh Kumar Date: Thu, 4 Sep 2014 12:01:22 +0000 (+0530) Subject: power-supply: Don't over-allocate memory for "supplied-from" array X-Git-Tag: fixes-against-v3.18-rc2~70^2~34 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f5a37cb28fce189f3d6802ade98a116f59a47bf;p=pandora-kernel.git 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 Signed-off-by: Sebastian Reichel --- Reading git-diff-tree failed