summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@iki.fi>2014-11-06 17:49:45 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-12-16 09:37:08 -0800
commit6d6a8c0b7e25f934d19da71d14084aa851e76ec6 (patch)
tree77a3210eea26ae73cb5f7909dbc9ddfbf522ae84
parentce7c82e8f8616f03120f8bed8e4f344b69fa6a47 (diff)
media: smiapp: Only some selection targets are settable
commit b31eb901c4e5eeef4c83c43dfbc7fe0d4348cb21 upstream. 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> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/media/i2c/smiapp/smiapp-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 62acb10630f9..818b48d3ac28 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2133,7 +2133,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);