V4L/DVB (10097): ov772x: clear i2c client data on error and remove
authorKuninori Morimoto <morimoto.kuninori@renesas.com>
Mon, 29 Dec 2008 09:04:37 +0000 (06:04 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 30 Dec 2008 11:40:29 +0000 (09:40 -0200)
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>
drivers/media/video/ov772x.c

index e7fb553c906e5fa5fef4faeb41c11b21b1a8df79..b3346c934bf373ec18d8387a3d43fd2bd9b2ada2 100644 (file)
@@ -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;
 }