]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[media] smiapp: Only some selection targets are settable
authorSakari Ailus <sakari.ailus@iki.fi>
Thu, 6 Nov 2014 20:49:45 +0000 (17:49 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 11 Nov 2014 11:13:36 +0000 (09:13 -0200)
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>
drivers/media/i2c/smiapp/smiapp-core.c

index 932ed9be9ff3d756fb35948e8183e09faaa60c34..b10aaeda2bb4599576849a8a5b786dcc2542aa49 100644 (file)
@@ -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);