Commit e7f3f9f3 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[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: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent c1292233
...@@ -353,7 +353,7 @@ static int si2157_probe(struct i2c_client *client, ...@@ -353,7 +353,7 @@ static int si2157_probe(struct i2c_client *client,
cmd.rlen = 1; cmd.rlen = 1;
ret = si2157_cmd_execute(client, &cmd); ret = si2157_cmd_execute(client, &cmd);
if (ret) if (ret)
goto err; goto err_kfree;
memcpy(&fe->ops.tuner_ops, &si2157_ops, sizeof(struct dvb_tuner_ops)); memcpy(&fe->ops.tuner_ops, &si2157_ops, sizeof(struct dvb_tuner_ops));
fe->tuner_priv = client; fe->tuner_priv = client;
...@@ -363,9 +363,11 @@ static int si2157_probe(struct i2c_client *client, ...@@ -363,9 +363,11 @@ static int si2157_probe(struct i2c_client *client,
"Si2146" : "Si2147/2148/2157/2158"); "Si2146" : "Si2147/2148/2157/2158");
return 0; return 0;
err_kfree:
kfree(dev);
err: err:
dev_dbg(&client->dev, "failed=%d\n", ret); dev_dbg(&client->dev, "failed=%d\n", ret);
kfree(dev);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment