From: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
To: Xiaomeng Tong <xiam0nd.tong@gmail.com>, <yannick.fertre@foss.st.com>
Cc: <philippe.cornu@foss.st.com>, <airlied@linux.ie>,
<daniel@ffwll.ch>, <mcoquelin.stm32@gmail.com>,
<alexandre.torgue@foss.st.com>, <marex@denx.de>,
<dri-devel@lists.freedesktop.org>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH] stm: ltdc: fix two incorrect NULL checks on list iterator
Date: Mon, 28 Mar 2022 14:37:37 +0200 [thread overview]
Message-ID: <be2042d2-e315-223d-5454-ebfb934f9d2d@foss.st.com> (raw)
In-Reply-To: <20220327055355.3808-1-xiam0nd.tong@gmail.com>
Hello Xiaomeng
On 3/27/22 07:53, Xiaomeng Tong wrote:
> The two bugs are here:
> if (encoder) {
> if (bridge && bridge->timings)
>
> The list iterator value 'encoder/bridge' will *always* be set and
> non-NULL by drm_for_each_encoder()/list_for_each_entry(), so it is
> incorrect to assume that the iterator value will be NULL if the
> list is empty or no element is found.
>
> To fix the bug, use a new variable '*_iter' as the list iterator,
> while use the old variable 'encoder/bridge' as a dedicated pointer
> to point to the found element.
>
> Cc: stable@vger.kernel.org
> Fixes: 99e360442f223 ("drm/stm: Fix bus_flags handling")
> Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
> ---
> drivers/gpu/drm/stm/ltdc.c | 16 ++++++++++------
> 1 file changed, 10 insertions(+), 6 deletions(-)
Thanks for your fix
Acked-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Raphaël Gallais-Pou
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-03-28 12:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-27 5:53 [PATCH] stm: ltdc: fix two incorrect NULL checks on list iterator Xiaomeng Tong
2022-03-28 12:37 ` Raphael Gallais-Pou [this message]
2022-04-07 9:01 ` Philippe CORNU
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=be2042d2-e315-223d-5454-ebfb934f9d2d@foss.st.com \
--to=raphael.gallais-pou@foss.st.com \
--cc=airlied@linux.ie \
--cc=alexandre.torgue@foss.st.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=marex@denx.de \
--cc=mcoquelin.stm32@gmail.com \
--cc=philippe.cornu@foss.st.com \
--cc=stable@vger.kernel.org \
--cc=xiam0nd.tong@gmail.com \
--cc=yannick.fertre@foss.st.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).