diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2011-11-07 12:44:12 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-11-24 07:27:47 -0500 |
commit | e469183541ac108fbc9bcf8e73c2061f049be620 (patch) | |
tree | eeb14c68f8098e0cb113f1bdad680182272df09a /drivers | |
parent | db9bc660cf4d1a09565f5db2bab9d3b86e3e32a5 (diff) |
[media] V4L: mt9t112: use after free in mt9t112_probe()
priv gets dereferenced in mt9t112_set_params() so we should return
before calling that.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/mt9t112.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c index 32114a3c0ca7..7b34b11daf24 100644 --- a/drivers/media/video/mt9t112.c +++ b/drivers/media/video/mt9t112.c | |||
@@ -1083,8 +1083,10 @@ static int mt9t112_probe(struct i2c_client *client, | |||
1083 | v4l2_i2c_subdev_init(&priv->subdev, client, &mt9t112_subdev_ops); | 1083 | v4l2_i2c_subdev_init(&priv->subdev, client, &mt9t112_subdev_ops); |
1084 | 1084 | ||
1085 | ret = mt9t112_camera_probe(client); | 1085 | ret = mt9t112_camera_probe(client); |
1086 | if (ret) | 1086 | if (ret) { |
1087 | kfree(priv); | 1087 | kfree(priv); |
1088 | return ret; | ||
1089 | } | ||
1088 | 1090 | ||
1089 | /* Cannot fail: using the default supported pixel code */ | 1091 | /* Cannot fail: using the default supported pixel code */ |
1090 | mt9t112_set_params(priv, &rect, V4L2_MBUS_FMT_UYVY8_2X8); | 1092 | mt9t112_set_params(priv, &rect, V4L2_MBUS_FMT_UYVY8_2X8); |