lkml.org 
[lkml]   [2021]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.11 668/775] media: ipu3-cio2: Fix mbus_code processing in cio2_subdev_set_fmt()
    Date
    From: Pavel Machek <pavel@denx.de>

    commit 334de4b45892f7e67074e1b1b2ac36fd3e091118 upstream.

    Loop was useless as it would always exit on the first iteration. Fix
    it with right condition.

    Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>
    Fixes: a86cf9b29e8b ("media: ipu3-cio2: Validate mbus format in setting subdev format")
    Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Cc: stable@vger.kernel.org # v4.16 and up
    Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/media/pci/intel/ipu3/ipu3-cio2.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c
    +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
    @@ -1269,7 +1269,7 @@ static int cio2_subdev_set_fmt(struct v4
    fmt->format.code = formats[0].mbus_code;

    for (i = 0; i < ARRAY_SIZE(formats); i++) {
    - if (formats[i].mbus_code == fmt->format.code) {
    + if (formats[i].mbus_code == mbus_code) {
    fmt->format.code = mbus_code;
    break;
    }

    \
     
     \ /
      Last update: 2021-03-02 14:40    [W:4.021 / U:1.092 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site