[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMeQTsa1YeB2GFyUUJ2PJxACZ2dgWprN8mneka=VXDn5o-7+HA@mail.gmail.com>
Date: Fri, 1 Apr 2022 12:03:10 +0200
From: Patrik Jakobsson <patrik.r.jakobsson@...il.com>
To: Xiaomeng Tong <xiam0nd.tong@...il.com>
Cc: David Airlie <airlied@...ux.ie>, Daniel Vetter <daniel@...ll.ch>,
Zhao Yakui <yakui.zhao@...el.com>,
Dave Airlie <airlied@...hat.com>,
dri-devel <dri-devel@...ts.freedesktop.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 4/5] gma500: fix a missing break in cdv_intel_dp_set_m_n
On Wed, Mar 30, 2022 at 2:03 PM Xiaomeng Tong <xiam0nd.tong@...il.com> wrote:
>
> Instead of exiting the loop as expected when an entry is found, the
> list_for_each_entry() continues until the traversal is complete. It
> could lead to a invalid reference to 'lane_count/bpp' after the loop.
>
> The invalid reference to 'lane_count/bpp' is here:
> cdv_intel_dp_compute_m_n(bpp, lane_count,
>
> To fix this, when found the entry, add a break after the switch statement.
>
> Fixes: 8695b61294356 ("gma500: Add the support of display port on CDV")
> Signed-off-by: Xiaomeng Tong <xiam0nd.tong@...il.com>
This loop already breaks when the desired conditions are met (see the
if statements).
> ---
> drivers/gpu/drm/gma500/cdv_intel_dp.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c
> index ba6ad1466374..e6473b8da296 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_dp.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c
> @@ -1016,6 +1016,8 @@ cdv_intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode,
> bpp = dev_priv->edp.bpp;
> break;
> }
> +
> + break;
> }
>
> /*
> --
> 2.17.1
>
Powered by blists - more mailing lists