Skip to content

Commit

Permalink
[media] V4L: mt9t112: use after free in mt9t112_probe()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Mauro Carvalho Chehab committed Nov 24, 2011
1 parent db9bc66 commit e469183
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/media/video/mt9t112.c
Original file line number Diff line number Diff line change
Expand Up @@ -1083,8 +1083,10 @@ static int mt9t112_probe(struct i2c_client *client,
v4l2_i2c_subdev_init(&priv->subdev, client, &mt9t112_subdev_ops);

ret = mt9t112_camera_probe(client);
if (ret)
if (ret) {
kfree(priv);
return ret;
}

/* Cannot fail: using the default supported pixel code */
mt9t112_set_params(priv, &rect, V4L2_MBUS_FMT_UYVY8_2X8);
Expand Down

0 comments on commit e469183

Please sign in to comment.