Use own label for kzalloc failure in which does not call kfree().
kfree() could be called with NULL, but it is still better to have
own label which skips unnecessary kfree().
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
if (!dev) {
ret = -ENOMEM;
dev_err(&client->dev, "kzalloc() failed\n");
- goto err_kfree;
+ goto err;
}
mutex_init(&dev->i2c_mutex);
return 0;
err_kfree:
kfree(dev);
+err:
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}