diff options
-rw-r--r-- | drivers/media/video/ov772x.c | 5 |
1 files changed, 4 insertions, 1 deletions
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, | |||
942 | 942 | ||
943 | ret = soc_camera_device_register(icd); | 943 | ret = soc_camera_device_register(icd); |
944 | 944 | ||
945 | if (ret) | 945 | if (ret) { |
946 | i2c_set_clientdata(client, NULL); | ||
946 | kfree(priv); | 947 | kfree(priv); |
948 | } | ||
947 | 949 | ||
948 | return ret; | 950 | return ret; |
949 | } | 951 | } |
@@ -953,6 +955,7 @@ static int ov772x_remove(struct i2c_client *client) | |||
953 | struct ov772x_priv *priv = i2c_get_clientdata(client); | 955 | struct ov772x_priv *priv = i2c_get_clientdata(client); |
954 | 956 | ||
955 | soc_camera_device_unregister(&priv->icd); | 957 | soc_camera_device_unregister(&priv->icd); |
958 | i2c_set_clientdata(client, NULL); | ||
956 | kfree(priv); | 959 | kfree(priv); |
957 | return 0; | 960 | return 0; |
958 | } | 961 | } |