mfd: Fix possible s5m null pointer dereference
authorJonghwan Choi <jhbird.choi@samsung.com>
Mon, 16 Jan 2012 00:08:42 +0000 (09:08 +0900)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 6 Mar 2012 17:46:35 +0000 (18:46 +0100)
This patch checks for pdata to using it.

Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/s5m-core.c

index e075c113eec6f7d77a67b5ca1eb145abe8eebbdf..caadabeed8e94d59ae55fd8dbde84b37014769bb 100644 (file)
@@ -105,7 +105,7 @@ static int s5m87xx_i2c_probe(struct i2c_client *i2c,
        s5m87xx->rtc = i2c_new_dummy(i2c->adapter, RTC_I2C_ADDR);
        i2c_set_clientdata(s5m87xx->rtc, s5m87xx);
 
-       if (pdata->cfg_pmic_irq)
+       if (pdata && pdata->cfg_pmic_irq)
                pdata->cfg_pmic_irq();
 
        s5m_irq_init(s5m87xx);