mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 11:54:14 -04:00
media: rj54n1cb0c: Fix memleak in rj54n1_probe()
[ Upstream commit fda55673ecdabf25f5ecc61b5ab17239257ac252 ]
rj54n1_probe() won't clean all the allocated resources in fail
path, which may causes the memleaks. Add v4l2_ctrl_handler_free() to
prevent memleak.
Fixes: f187352dcd ("media: i2c: Copy rj54n1cb0c soc_camera sensor driver")
Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
d186a8200b
commit
a05e38d179
1 changed files with 6 additions and 3 deletions
|
|
@ -1332,10 +1332,13 @@ static int rj54n1_probe(struct i2c_client *client,
|
|||
V4L2_CID_GAIN, 0, 127, 1, 66);
|
||||
v4l2_ctrl_new_std(&rj54n1->hdl, &rj54n1_ctrl_ops,
|
||||
V4L2_CID_AUTO_WHITE_BALANCE, 0, 1, 1, 1);
|
||||
rj54n1->subdev.ctrl_handler = &rj54n1->hdl;
|
||||
if (rj54n1->hdl.error)
|
||||
return rj54n1->hdl.error;
|
||||
|
||||
if (rj54n1->hdl.error) {
|
||||
ret = rj54n1->hdl.error;
|
||||
goto err_free_ctrl;
|
||||
}
|
||||
|
||||
rj54n1->subdev.ctrl_handler = &rj54n1->hdl;
|
||||
rj54n1->clk_div = clk_div;
|
||||
rj54n1->rect.left = RJ54N1_COLUMN_SKIP;
|
||||
rj54n1->rect.top = RJ54N1_ROW_SKIP;
|
||||
|
|
|
|||
Loading…
Reference in a new issue