]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: rkisp1: Properly handle result of rkisp1_params_init_vb2_queue()
authorStefan Klug <stefan.klug@ideasonboard.com>
Fri, 23 May 2025 15:14:30 +0000 (17:14 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Wed, 18 Jun 2025 07:21:58 +0000 (09:21 +0200)
Properly handle the return of rkisp1_params_init_vb2_queue(). It is very
unlikely that this ever fails without code changes but should be handled
anyways.

While at it rename the error label for easier extension in the upcoming
patch.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20250523-supported-params-and-wdr-v3-1-7283b8536694@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/platform/rockchip/rkisp1/rkisp1-params.c

index b28f4140c8a309a3231d44d825c6461e3ecb2a44..24a8de697f2b2261aa305a3b1f52d80e008eb095 100644 (file)
@@ -2763,7 +2763,9 @@ int rkisp1_params_register(struct rkisp1_device *rkisp1)
        vdev->queue = &node->buf_queue;
        vdev->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_META_OUTPUT;
        vdev->vfl_dir = VFL_DIR_TX;
-       rkisp1_params_init_vb2_queue(vdev->queue, params);
+       ret = rkisp1_params_init_vb2_queue(vdev->queue, params);
+       if (ret)
+               goto err_media;
 
        params->metafmt = &rkisp1_params_formats[RKISP1_PARAMS_FIXED];
 
@@ -2777,18 +2779,18 @@ int rkisp1_params_register(struct rkisp1_device *rkisp1)
        node->pad.flags = MEDIA_PAD_FL_SOURCE;
        ret = media_entity_pads_init(&vdev->entity, 1, &node->pad);
        if (ret)
-               goto error;
+               goto err_media;
 
        ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
        if (ret) {
                dev_err(rkisp1->dev,
                        "failed to register %s, ret=%d\n", vdev->name, ret);
-               goto error;
+               goto err_media;
        }
 
        return 0;
 
-error:
+err_media:
        media_entity_cleanup(&vdev->entity);
        mutex_destroy(&node->vlock);
        return ret;