From: Kuninori Morimoto Date: Mon, 29 Dec 2008 09:04:37 +0000 (-0300) Subject: V4L/DVB (10097): ov772x: clear i2c client data on error and remove X-Git-Tag: MMI-PSA29.97-13-9~30449^2~22 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=77fe3d4a44f76653263eb8671d7909ab0fdafd71;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git V4L/DVB (10097): ov772x: clear i2c client data on error and remove Signed-off-by: Kuninori Morimoto Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/ov772x.c b/drivers/media/video/ov772x.c index e7fb553c906e..b3346c934bf3 100644 --- a/drivers/media/video/ov772x.c +++ b/drivers/media/video/ov772x.c @@ -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; } @@ -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; }