]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: i2c: ds90ub913: Fix returned fmt from .set_fmt()
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Mon, 3 Mar 2025 16:02:05 +0000 (21:32 +0530)
committerHans Verkuil <hverkuil@xs4all.nl>
Fri, 25 Apr 2025 08:15:03 +0000 (10:15 +0200)
When setting the sink pad's stream format, set_fmt accidentally changes
the returned format's code to 'outcode', while the purpose is to only
use the 'outcode' for the propagated source stream format.

Fixes: c158d0d4ff15 ("media: i2c: add DS90UB913 driver")
Cc: stable@vger.kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/i2c/ds90ub913.c

index fd2d2d5272bfb688f00d7bf5a109e978f6c322e6..1445ebbcc9cabb3ab43a670aa165deea52db5f35 100644 (file)
@@ -450,10 +450,10 @@ static int ub913_set_fmt(struct v4l2_subdev *sd,
        if (!fmt)
                return -EINVAL;
 
-       format->format.code = finfo->outcode;
-
        *fmt = format->format;
 
+       fmt->code = finfo->outcode;
+
        return 0;
 }