summaryrefslogtreecommitdiffstats
path: root/drivers/media/tuners/si2157.c
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2014-12-06 19:13:31 +0100
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-01-29 21:49:25 +0100
commite7f3f9f36235ca604c336c424709a6ecdd39ce8f (patch)
treef15c92629c6e7601316ce4fb2633e39bfce04273 /drivers/media/tuners/si2157.c
parent[media] si2157: trivial ID table changes (diff)
downloadlinux-e7f3f9f36235ca604c336c424709a6ecdd39ce8f.tar.xz
linux-e7f3f9f36235ca604c336c424709a6ecdd39ce8f.zip
[media] si2157: add own goto label for kfree() on probe error
Use own goto label for error case mem free is needed, even kfree could be called with NULL. I think it is better to have it, even not required. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/tuners/si2157.c')
-rw-r--r--drivers/media/tuners/si2157.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
index 211d500a74dd..3f9aa7ae1613 100644
--- a/drivers/media/tuners/si2157.c
+++ b/drivers/media/tuners/si2157.c
@@ -353,7 +353,7 @@ static int si2157_probe(struct i2c_client *client,
cmd.rlen = 1;
ret = si2157_cmd_execute(client, &cmd);
if (ret)
- goto err;
+ goto err_kfree;
memcpy(&fe->ops.tuner_ops, &si2157_ops, sizeof(struct dvb_tuner_ops));
fe->tuner_priv = client;
@@ -363,9 +363,11 @@ static int si2157_probe(struct i2c_client *client,
"Si2146" : "Si2147/2148/2157/2158");
return 0;
+
+err_kfree:
+ kfree(dev);
err:
dev_dbg(&client->dev, "failed=%d\n", ret);
- kfree(dev);
return ret;
}