Commit 77fe3d4a authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mauro Carvalho Chehab

V4L/DVB (10097): ov772x: clear i2c client data on error and remove

Signed-off-by: default avatarKuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 7dcb212e
...@@ -942,8 +942,10 @@ static int ov772x_probe(struct i2c_client *client, ...@@ -942,8 +942,10 @@ static int ov772x_probe(struct i2c_client *client,
ret = soc_camera_device_register(icd); ret = soc_camera_device_register(icd);
if (ret) if (ret) {
i2c_set_clientdata(client, NULL);
kfree(priv); kfree(priv);
}
return ret; return ret;
} }
...@@ -953,6 +955,7 @@ static int ov772x_remove(struct i2c_client *client) ...@@ -953,6 +955,7 @@ static int ov772x_remove(struct i2c_client *client)
struct ov772x_priv *priv = i2c_get_clientdata(client); struct ov772x_priv *priv = i2c_get_clientdata(client);
soc_camera_device_unregister(&priv->icd); soc_camera_device_unregister(&priv->icd);
i2c_set_clientdata(client, NULL);
kfree(priv); kfree(priv);
return 0; return 0;
} }
......
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