Skip to content

Commit

Permalink
[media] smiapp: Only some selection targets are settable
Browse files Browse the repository at this point in the history
Setting a non-settable selection target caused BUG() to be called. The check
for valid selections only takes the selection target into account, but does
not tell whether it may be set, or only get. Fix the issue by simply
returning an error to the user.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Cc: stable@vger.kernel.org	# for v3.10 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  • Loading branch information
Sakari Ailus authored and Mauro Carvalho Chehab committed Nov 11, 2014
1 parent 167921c commit b31eb90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/i2c/smiapp/smiapp-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2190,7 +2190,7 @@ static int smiapp_set_selection(struct v4l2_subdev *subdev,
ret = smiapp_set_compose(subdev, fh, sel);
break;
default:
BUG();
ret = -EINVAL;
}

mutex_unlock(&sensor->mutex);
Expand Down

0 comments on commit b31eb90

Please sign in to comment.