Skip to contentSkip to conversation

v4l2-ctrls: replace BUG_ON by WARN_ON

PATCH New Hans Verkuil 1 participant 1 message Feb 21, 2014 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 v4l2-ctrls: replace BUG_ON by WARN_ON

BUG_ON is unnecessarily strict.

---
 drivers/media/v4l2-core/v4l2-ctrls.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/v4l2-core/v4l2-ctrls.c +2 -1
index 6ff002b..35d551d 100644
@@ -1921,7 +1921,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]) {
Signature · 1 line
1.9.0