summaryrefslogtreecommitdiff
path: root/drivers
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:34:26 -0800
commitca09672ce470aa60493917347966ae84d1e83564 (patch)
tree13731fd671eeabba03374c2707f32c8ef7b1d69c /drivers
parente1811f07e9f65f7dfe30106361ebb5bd6308af08 (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>
Diffstat (limited to 'drivers')
-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 8741cae9c9f2..7026ab08ec91 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2138,7 +2138,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);