Skip to content

Commit

Permalink
media: ov7740: fix unbalanced pm_runtime_get/put
Browse files Browse the repository at this point in the history
Avoid returning without decrement the usage count in s_ctrl().

Cc: Wenyou Yang <[email protected]>
Cc: Eugen Hristev <[email protected]>
Signed-off-by: Akinobu Mita <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
mita authored and mchehab committed May 23, 2019
1 parent 428d3c8 commit cfe7cc3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/media/i2c/ov7740.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,16 +561,16 @@ static int ov7740_set_ctrl(struct v4l2_ctrl *ctrl)
break;
case V4L2_CID_AUTOGAIN:
if (!ctrl->val)
return ov7740_set_gain(regmap, ov7740->gain->val);

ret = ov7740_set_autogain(regmap, ctrl->val);
ret = ov7740_set_gain(regmap, ov7740->gain->val);
else
ret = ov7740_set_autogain(regmap, ctrl->val);
break;

case V4L2_CID_EXPOSURE_AUTO:
if (ctrl->val == V4L2_EXPOSURE_MANUAL)
return ov7740_set_exp(regmap, ov7740->exposure->val);

ret = ov7740_set_autoexp(regmap, ctrl->val);
ret = ov7740_set_exp(regmap, ov7740->exposure->val);
else
ret = ov7740_set_autoexp(regmap, ctrl->val);
break;
default:
ret = -EINVAL;
Expand Down

0 comments on commit cfe7cc3

Please sign in to comment.