From: Stephen Warren Date: Thu, 23 Aug 2012 18:19:18 +0000 (-0600) Subject: regulator: max8907: fix use of possibly NULL idata X-Git-Tag: omap-for-v3.7-rc1/fixes-cpufreq-signed~106^2^5~14 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fc72f57e62e10d9d8347ae20f13820d811377da;p=pandora-kernel.git regulator: max8907: fix use of possibly NULL idata If a regulator is not used by a board, it's quite legitimate not to provide platform data or a device tree node to configure it (i.e. regulator_init_data). In that case, during MAX8907 regulator's probe(), the idata variable will be NULL for that regulator. Prevent dereferincing it. If the MBATT regulator's init_data is not specified, or no name was specified in the constraints, the regulator will be named based on the regulator descriptor, so initialize mbatt_rail_name from there. Signed-off-by: Stephen Warren Signed-off-by: Mark Brown --- Reading git-diff-tree failed