提交 1ee5e7dd 编写于 作者: A Antti Palosaari 提交者: Mauro Carvalho Chehab

[media] si2168: add own goto label for kzalloc failure

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: NAntti Palosaari <crope@iki.fi>
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 e5dd1100
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册