]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] si2168: add own goto label for kzalloc failure
authorAntti Palosaari <crope@iki.fi>
Fri, 5 Dec 2014 19:02:42 +0000 (16:02 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 29 Jan 2015 20:43:16 +0000 (18:43 -0200)
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>
drivers/media/dvb-frontends/si2168.c

index f3fabd5fe455d39a6eb215ef129cf43dcc1ea843..06e54d10cc4f8f45c5a5477e9df50c000042b03b 100644 (file)
@@ -672,7 +672,7 @@ static int si2168_probe(struct i2c_client *client,
        if (!dev) {
                ret = -ENOMEM;
                dev_err(&client->dev, "kzalloc() failed\n");
-               goto err_kfree;
+               goto err;
        }
 
        mutex_init(&dev->i2c_mutex);
@@ -700,6 +700,7 @@ static int si2168_probe(struct i2c_client *client,
        return 0;
 err_kfree:
        kfree(dev);
+err:
        dev_dbg(&client->dev, "failed=%d\n", ret);
        return ret;
 }