All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
To: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Cc: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Zhao Yakui <yakui.zhao@intel.com>,
	Dave Airlie <airlied@redhat.com>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/5] gma500: fix a missing break in cdv_intel_crtc_mode_set
Date: Fri, 1 Apr 2022 11:28:19 +0200	[thread overview]
Message-ID: <CAMeQTsbZ4u=3pzu5p-4tt+kAiwmL2m+ZrCfzzv1vCMFeDAbDhQ@mail.gmail.com> (raw)
In-Reply-To: <20220330120246.25580-3-xiam0nd.tong@gmail.com>

On Wed, Mar 30, 2022 at 2:03 PM Xiaomeng Tong <xiam0nd.tong@gmail.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 'ddi_select' after the loop, and
> could lead to multiple 'is_*' flags being set with true mistakely, too.
>
> The invalid reference to 'ddi_select' is here:
>         cdv_dpll_set_clock_cdv(dev, crtc, &clock, is_lvds, ddi_select);
>
> To fix this, when found the entry, add a break after the switch statement.
>
> Fixes: d66760962d75 ("gma500: Program the DPLL lane based on the selected digitial port")
> Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>

Hi, this one is also already fixed in:

commit b1a7d0ddb169774c3db5afe9e64124daea7fdd9f
Author: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Date:   Tue Mar 22 14:17:38 2022 +0100

    drm/gma500: Make use of the drm connector iterator

> ---
>  drivers/gpu/drm/gma500/cdv_intel_display.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_display.c b/drivers/gpu/drm/gma500/cdv_intel_display.c
> index 94ebc48a4349..3e93019b17cb 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_display.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_display.c
> @@ -616,6 +616,8 @@ static int cdv_intel_crtc_mode_set(struct drm_crtc *crtc,
>                         DRM_ERROR("invalid output type.\n");
>                         return 0;
>                 }
> +
> +               break;
>         }
>
>         if (dev_priv->dplla_96mhz)
> --
> 2.17.1
>

WARNING: multiple messages have this Message-ID (diff)
From: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
To: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Cc: David Airlie <airlied@linux.ie>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Zhao Yakui <yakui.zhao@intel.com>,
	Dave Airlie <airlied@redhat.com>
Subject: Re: [PATCH 2/5] gma500: fix a missing break in cdv_intel_crtc_mode_set
Date: Fri, 1 Apr 2022 11:28:19 +0200	[thread overview]
Message-ID: <CAMeQTsbZ4u=3pzu5p-4tt+kAiwmL2m+ZrCfzzv1vCMFeDAbDhQ@mail.gmail.com> (raw)
In-Reply-To: <20220330120246.25580-3-xiam0nd.tong@gmail.com>

On Wed, Mar 30, 2022 at 2:03 PM Xiaomeng Tong <xiam0nd.tong@gmail.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 'ddi_select' after the loop, and
> could lead to multiple 'is_*' flags being set with true mistakely, too.
>
> The invalid reference to 'ddi_select' is here:
>         cdv_dpll_set_clock_cdv(dev, crtc, &clock, is_lvds, ddi_select);
>
> To fix this, when found the entry, add a break after the switch statement.
>
> Fixes: d66760962d75 ("gma500: Program the DPLL lane based on the selected digitial port")
> Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>

Hi, this one is also already fixed in:

commit b1a7d0ddb169774c3db5afe9e64124daea7fdd9f
Author: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Date:   Tue Mar 22 14:17:38 2022 +0100

    drm/gma500: Make use of the drm connector iterator

> ---
>  drivers/gpu/drm/gma500/cdv_intel_display.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_display.c b/drivers/gpu/drm/gma500/cdv_intel_display.c
> index 94ebc48a4349..3e93019b17cb 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_display.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_display.c
> @@ -616,6 +616,8 @@ static int cdv_intel_crtc_mode_set(struct drm_crtc *crtc,
>                         DRM_ERROR("invalid output type.\n");
>                         return 0;
>                 }
> +
> +               break;
>         }
>
>         if (dev_priv->dplla_96mhz)
> --
> 2.17.1
>

  reply	other threads:[~2022-04-01  9:28 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-30 12:02 [PATCH 0/5] fix missing break in list_or_each_entry Xiaomeng Tong
2022-03-30 12:02 ` Xiaomeng Tong
2022-03-30 12:02 ` [PATCH 1/5] gma500: fix a missing break in oaktrail_crtc_mode_set Xiaomeng Tong
2022-03-30 12:02   ` Xiaomeng Tong
2022-04-01  9:25   ` Patrik Jakobsson
2022-04-01  9:25     ` Patrik Jakobsson
2022-03-30 12:02 ` [PATCH 2/5] gma500: fix a missing break in cdv_intel_crtc_mode_set Xiaomeng Tong
2022-03-30 12:02   ` Xiaomeng Tong
2022-04-01  9:28   ` Patrik Jakobsson [this message]
2022-04-01  9:28     ` Patrik Jakobsson
2022-03-30 12:02 ` [PATCH 3/5] gma500: fix a missing break in psb_intel_crtc_mode_set Xiaomeng Tong
2022-03-30 12:02   ` Xiaomeng Tong
2022-04-01  9:53   ` Patrik Jakobsson
2022-04-01  9:53     ` Patrik Jakobsson
2022-04-01 11:07     ` Xiaomeng Tong
2022-04-01 11:07       ` Xiaomeng Tong
2022-03-30 12:02 ` [PATCH 4/5] gma500: fix a missing break in cdv_intel_dp_set_m_n Xiaomeng Tong
2022-03-30 12:02   ` Xiaomeng Tong
2022-04-01 10:03   ` Patrik Jakobsson
2022-04-01 10:03     ` Patrik Jakobsson
2022-03-30 12:02 ` [PATCH 5/5] gma500: fix a missing break in psb_driver_load Xiaomeng Tong
2022-03-30 12:02   ` Xiaomeng Tong
2022-04-01 10:10   ` Patrik Jakobsson
2022-04-01 10:10     ` Patrik Jakobsson
2022-04-01 11:16     ` Xiaomeng Tong
2022-04-01 11:16       ` Xiaomeng Tong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMeQTsbZ4u=3pzu5p-4tt+kAiwmL2m+ZrCfzzv1vCMFeDAbDhQ@mail.gmail.com' \
    --to=patrik.r.jakobsson@gmail.com \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiam0nd.tong@gmail.com \
    --cc=yakui.zhao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.