From: Stephen Warren Date: Tue, 29 Jan 2013 19:01:13 +0000 (-0700) Subject: regulator: clear state each invocation of of_regulator_match X-Git-Tag: v3.8-rc7~9^2~3^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2f95c363701deba2205f81929b40222ea6f4f80;p=pandora-kernel.git regulator: clear state each invocation of of_regulator_match of_regulator_match() saves some dynamcially allocated state into the match table that's passed to it. By implementation and not contract, for each match table entry, if non-NULL state is already present, of_regulator_match() will not overwrite it. of_regulator_match() is typically called each time a regulator is probe()d. This means it is called with the same match table over and over again if a regulator triggers deferred probe. This results in stale, kfree()d data being left in the match table from probe to probe, which causes a variety of crashes or use of invalid data. Explicitly free all output state from of_regulator_match() before generating new results in order to avoid this. Signed-off-by: Stephen Warren Signed-off-by: Mark Brown Cc: stable@vger.kernel.org --- Reading git-diff-tree failed