提交 08da558a 编写于 作者: D Dan Carpenter 提交者: Mauro Carvalho Chehab

[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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 4c0b036d
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册