Skip to contentSkip to conversation

Staging: vc04_services: Fix a couple error codes

PATCH In review Dan Carpenter 2 participants 2 messages May 13, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: vc04_services: Fix a couple error codes

These are accidentally returning positive EINVAL instead of negative -EINVAL. Some of the callers treat positive values as success.

Fixes 7b3ad5abf027 ("staging: Import the BCM2835 MMAL-based V4L2 camera driver.")
---
 drivers/staging/vc04_services/bcm2835-camera/controls.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/vc04_services/bcm2835-camera/controls.c +2 -2
index 9841c30450ce..dade79738a29 100644
@@ -572,7 +572,7 @@ static int ctrl_set_image_effect(struct bm2835_mmal_dev *dev,
 				dev->colourfx.enable ? "true" : "false",
 				dev->colourfx.u, dev->colourfx.v,
 				ret, (ret = 0 ? 0 : -EINVAL));
-	return (ret = 0 ? 0 : EINVAL);
+	return (ret = 0 ? 0 : -EINVAL);
 }
 
 static int ctrl_set_colfx(struct bm2835_mmal_dev *dev,
@@ -596,7 +596,7 @@ static int ctrl_set_colfx(struct bm2835_mmal_dev *dev,
 		 "%s: After: mmal_ctrl:%p ctrl id:0x%x ctrl val:%d ret %d(%d)\n",
 			__func__, mmal_ctrl, ctrl->id, ctrl->val, ret,
 			(ret = 0 ? 0 : -EINVAL));
-	return (ret = 0 ? 0 : EINVAL);
+	return (ret = 0 ? 0 : -EINVAL);
 }
 
 static int ctrl_set_bitrate(struct bm2835_mmal_dev *dev,
Signature · 1 line
2.20.1