mfd: Do not dereference null pointer in twl4030 error path
authorIlkka Koskinen <ilkka.koskinen@nokia.com>
Tue, 20 Oct 2009 13:22:52 +0000 (16:22 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 26 Oct 2009 23:20:33 +0000 (00:20 +0100)
We are mistakenly dereferencing twl->client in the twl->client null checking
path.

Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/twl4030-core.c

index e832e975da606386bf85d9e77b0a94417ad29015..a1c47ee95c0eef065e591cfeadde949eafb8e414 100644 (file)
@@ -795,7 +795,7 @@ twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id)
                        twl->client = i2c_new_dummy(client->adapter,
                                        twl->address);
                        if (!twl->client) {
-                               dev_err(&twl->client->dev,
+                               dev_err(&client->dev,
                                        "can't attach client %d\n", i);
                                status = -ENOMEM;
                                goto fail;