Fixes a possible NULL pointer violation. Tested on SDP 3430. Signed-off-by: Romit Dasgupta <romit@xxxxxx> --- diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index 07e40dc..fd5504c 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c @@ -352,11 +352,9 @@ void __init twl4030_power_init(struct twl4030_power_data *triton2_scripts) } resconfig = triton2_scripts->resource_config; - if (resconfig) { - while (resconfig->resource) { + while (resconfig && resconfig->resource) { twl4030_configure_resource(resconfig); resconfig++; - } } if (twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0, R_PROTECT_KEY)) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html