[media] v4l2-ctrls: replace BUG_ON by WARN_ON
authorHans Verkuil <hverkuil@xs4all.nl>
Fri, 21 Feb 2014 09:16:32 +0000 (06:16 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 11 Mar 2014 12:22:22 +0000 (09:22 -0300)
BUG_ON is unnecessarily strict.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/v4l2-core/v4l2-ctrls.c

index 1168f683fd48bf64ee70676524c2aa72c7b5754d..5c3e8ca9b1d197e4d0840ffac5fd27bf80d4e388 100644 (file)
@@ -1942,7 +1942,8 @@ void v4l2_ctrl_cluster(unsigned ncontrols, struct v4l2_ctrl **controls)
        int i;
 
        /* The first control is the master control and it must not be NULL */
-       BUG_ON(ncontrols == 0 || controls[0] == NULL);
+       if (WARN_ON(ncontrols == 0 || controls[0] == NULL))
+               return;
 
        for (i = 0; i < ncontrols; i++) {
                if (controls[i]) {