Skip to content

Commit

Permalink
V4L/DVB (10097): ov772x: clear i2c client data on error and remove
Browse files Browse the repository at this point in the history
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Kuninori Morimoto authored and Mauro Carvalho Chehab committed Dec 30, 2008
1 parent 7dcb212 commit 77fe3d4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/media/video/ov772x.c
Original file line number Diff line number Diff line change
Expand Up @@ -942,8 +942,10 @@ static int ov772x_probe(struct i2c_client *client,

ret = soc_camera_device_register(icd);

if (ret)
if (ret) {
i2c_set_clientdata(client, NULL);
kfree(priv);
}

return ret;
}
Expand All @@ -953,6 +955,7 @@ static int ov772x_remove(struct i2c_client *client)
struct ov772x_priv *priv = i2c_get_clientdata(client);

soc_camera_device_unregister(&priv->icd);
i2c_set_clientdata(client, NULL);
kfree(priv);
return 0;
}
Expand Down

0 comments on commit 77fe3d4

Please sign in to comment.