From: Giulio Benetti <giulio.benetti@micronovasrl.com>
To: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: David Airlie <airlied@linux.ie>, Chen-Yu Tsai <wens@csie.org>,
dri-devel@lists.freedesktop.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH 1/2] drm/sun4i: tcon: fix check of tcon->panel null pointer
Date: Wed, 3 Oct 2018 00:00:55 +0200 [thread overview]
Message-ID: <e8344f9e-54af-e287-c992-4494d8a54025@micronovasrl.com> (raw)
In-Reply-To: <20181002215917.1849-1-giulio.benetti@micronovasrl.com>
Sorry for sending twice(and top posting), but I was not subscribed to
dri-devel ML, so patchwork was not aware of these 2 patches.
Best regards
--
Giulio Benetti
CTO
MICRONOVA SRL
Sede: Via A. Niedda 3 - 35010 Vigonza (PD)
Tel. 049/8931563 - Fax 049/8931346
Cod.Fiscale - P.IVA 02663420285
Capitale Sociale € 26.000 i.v.
Iscritta al Reg. Imprese di Padova N. 02663420285
Numero R.E.A. 258642
Il 02/10/2018 23:59, Giulio Benetti ha scritto:
> At the moment, the check of tcon->panel to be valid is wrong. IS_ERR()
> has been used, but that macro doesn't check if tcon->panel pointer is
> null or not, but check if tcon->panel is between -1 and -4095(MAX_ERRNO).
>
> Remove IS_ERR() from tcon->panel checking and let "if (tcon->panel)" as
> condition to check if it's a pointer not null.
>
> Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
> ---
> drivers/gpu/drm/sun4i/sun4i_tcon.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> index c78cd35a1294..e4b3bd0307ef 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> @@ -555,7 +555,7 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
> * Following code is a way to avoid quirks all around TCON
> * and DOTCLOCK drivers.
> */
> - if (!IS_ERR(tcon->panel)) {
> + if (tcon->panel) {
> struct drm_panel *panel = tcon->panel;
> struct drm_connector *connector = panel->connector;
> struct drm_display_info display_info = connector->display_info;
>
next prev parent reply other threads:[~2018-10-02 22:01 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20181001093612.GA13672@mwanda>
2018-10-02 20:48 ` Giulio Benetti
2018-10-02 20:49 ` [PATCH 2/2] drm/sun4i: tcon: prevent tcon->panel dereference if null Giulio Benetti
2018-10-02 21:59 ` [PATCH 1/2] drm/sun4i: tcon: fix check of tcon->panel null pointer Giulio Benetti
2018-10-02 21:59 ` [PATCH 2/2] drm/sun4i: tcon: prevent tcon->panel dereference if null Giulio Benetti
2018-10-03 7:34 ` Chen-Yu Tsai
2018-10-02 22:00 ` Giulio Benetti [this message]
2018-10-03 9:43 ` [PATCH 1/2] drm/sun4i: tcon: fix check of tcon->panel null pointer Chen-Yu Tsai
2018-10-03 12:13 ` Giulio Benetti
2018-10-03 14:24 ` [PATCH v2 " Giulio Benetti
2018-10-03 14:24 ` [PATCH v2 2/2] drm/sun4i: tcon: prevent tcon->panel dereference if null Giulio Benetti
2018-10-04 19:56 ` Maxime Ripard
2018-10-05 21:38 ` Giulio Benetti
2018-10-05 21:59 ` [PATCH v3 1/2] drm/sun4i: tcon: fix check of tcon->panel null pointer Giulio Benetti
2018-10-05 21:59 ` [PATCH v3 2/2] drm/sun4i: tcon: prevent tcon->panel dereference if NULL Giulio Benetti
2018-10-08 9:21 ` Maxime Ripard
2018-10-12 10:03 ` Chen-Yu Tsai
2018-11-05 13:23 ` Icenowy Zheng
2018-11-06 15:57 ` Maxime Ripard
2018-10-04 19:54 ` [PATCH v2 1/2] drm/sun4i: tcon: fix check of tcon->panel null pointer Maxime Ripard
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=e8344f9e-54af-e287-c992-4494d8a54025@micronovasrl.com \
--to=giulio.benetti@micronovasrl.com \
--cc=airlied@linux.ie \
--cc=dan.carpenter@oracle.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.ripard@bootlin.com \
--cc=wens@csie.org \
/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
all inboxes | Powered by JetHome®