aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2025-11-11 13:07:29 +0200
committerHans Verkuil <hverkuil+cisco@kernel.org>2026-01-14 23:33:02 +0100
commite3d5436c7099881e3604826757c8d65acc2d94f3 (patch)
tree8358302d88b7b426cde869a14f7366036c92e16d /drivers
parent2759816f1682ca6a269064b7b9d50a65bc3afd5d (diff)
media: v4l2-ctrls: Set error v4l2_ctrl_new_fwnode_properties consistently
The vast majority of the callers of v4l2_ctrl_new_fwnode_properties() do check the returned error code but the function does not set the control handler's error on failure. This will make error handling more complicated and prone for bugs. Always assign the control handler's error field on error in v4l2_ctrl_new_fwnode_properties(). Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/v4l2-core/v4l2-ctrls-core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/v4l2-core/v4l2-ctrls-core.c b/drivers/media/v4l2-core/v4l2-ctrls-core.c
index 209bc05883bb..1d4b5859f0e2 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls-core.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls-core.c
@@ -2780,7 +2780,8 @@ int v4l2_ctrl_new_fwnode_properties(struct v4l2_ctrl_handler *hdl,
orientation_ctrl = V4L2_CAMERA_ORIENTATION_EXTERNAL;
break;
default:
- return -EINVAL;
+ hdl->error = -EINVAL;
+ return hdl->error;
}
if (!v4l2_ctrl_new_std_menu(hdl, ctrl_ops,
V4L2_CID_CAMERA_ORIENTATION,