All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: Harry Wentland <harry.wentland@amd.com>
Cc: "José Expósito" <jose.exposito89@gmail.com>,
	"Jude Shih" <shenshih@amd.com>,
	"Anson Jacob" <Anson.Jacob@amd.com>,
	"Leo (Sunpeng) Li" <sunpeng.li@amd.com>,
	"xinhui pan" <Xinhui.Pan@amd.com>,
	"Siqueira, Rodrigo" <Rodrigo.Siqueira@amd.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"amd-gfx list" <amd-gfx@lists.freedesktop.org>,
	"Kazlauskas, Nicholas" <nicholas.kazlauskas@amd.com>,
	"Dave Airlie" <airlied@linux.ie>,
	"Maling list - DRI developers" <dri-devel@lists.freedesktop.org>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Deucher, Alexander" <alexander.deucher@amd.com>,
	"Christian Koenig" <christian.koenig@amd.com>
Subject: Re: [PATCH] drm/amd/display: invalid parameter check in dmub_hpd_callback
Date: Mon, 10 Jan 2022 13:37:34 -0500	[thread overview]
Message-ID: <CADnq5_N1-kKfhZ9mttcRq7RON0DsEjs1cpvxo4M7jJN3M8Sx9w@mail.gmail.com> (raw)
In-Reply-To: <139784cd-6cb7-18e0-bb09-b35113bd83ef@amd.com>

Applied.  Thanks!

Alex

On Mon, Jan 10, 2022 at 11:34 AM Harry Wentland <harry.wentland@amd.com> wrote:
>
> On 2022-01-09 13:42, José Expósito wrote:
> > The function performs a check on the "adev" input parameter, however, it
> > is used before the check.
> >
> > Initialize the "dev" variable after the sanity check to avoid a possible
> > NULL pointer dereference.
> >
> > Fixes: e27c41d5b0681 ("drm/amd/display: Support for DMUB HPD interrupt handling")
> > Addresses-Coverity-ID: 1493909 ("Null pointer dereference")
> > Signed-off-by: José Expósito <jose.exposito89@gmail.com>
>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>
> Harry
>
> > ---
> >  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > index e727f1dd2a9a..7fbded7a6d9c 100644
> > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > @@ -656,7 +656,7 @@ void dmub_hpd_callback(struct amdgpu_device *adev, struct dmub_notification *not
> >       struct drm_connector_list_iter iter;
> >       struct dc_link *link;
> >       uint8_t link_index = 0;
> > -     struct drm_device *dev = adev->dm.ddev;
> > +     struct drm_device *dev;
> >
> >       if (adev == NULL)
> >               return;
> > @@ -673,6 +673,7 @@ void dmub_hpd_callback(struct amdgpu_device *adev, struct dmub_notification *not
> >
> >       link_index = notify->link_index;
> >       link = adev->dm.dc->links[link_index];
> > +     dev = adev->dm.ddev;
> >
> >       drm_connector_list_iter_begin(dev, &iter);
> >       drm_for_each_connector_iter(connector, &iter) {
>

WARNING: multiple messages have this Message-ID (diff)
From: Alex Deucher <alexdeucher@gmail.com>
To: Harry Wentland <harry.wentland@amd.com>
Cc: "Anson Jacob" <Anson.Jacob@amd.com>,
	"Jude Shih" <shenshih@amd.com>, "Dave Airlie" <airlied@linux.ie>,
	"xinhui pan" <Xinhui.Pan@amd.com>,
	"Siqueira, Rodrigo" <Rodrigo.Siqueira@amd.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"amd-gfx list" <amd-gfx@lists.freedesktop.org>,
	"Christian Koenig" <christian.koenig@amd.com>,
	"Leo (Sunpeng) Li" <sunpeng.li@amd.com>,
	"Maling list - DRI developers" <dri-devel@lists.freedesktop.org>,
	"Deucher, Alexander" <alexander.deucher@amd.com>,
	"José Expósito" <jose.exposito89@gmail.com>,
	"Kazlauskas, Nicholas" <nicholas.kazlauskas@amd.com>
Subject: Re: [PATCH] drm/amd/display: invalid parameter check in dmub_hpd_callback
Date: Mon, 10 Jan 2022 13:37:34 -0500	[thread overview]
Message-ID: <CADnq5_N1-kKfhZ9mttcRq7RON0DsEjs1cpvxo4M7jJN3M8Sx9w@mail.gmail.com> (raw)
In-Reply-To: <139784cd-6cb7-18e0-bb09-b35113bd83ef@amd.com>

Applied.  Thanks!

Alex

On Mon, Jan 10, 2022 at 11:34 AM Harry Wentland <harry.wentland@amd.com> wrote:
>
> On 2022-01-09 13:42, José Expósito wrote:
> > The function performs a check on the "adev" input parameter, however, it
> > is used before the check.
> >
> > Initialize the "dev" variable after the sanity check to avoid a possible
> > NULL pointer dereference.
> >
> > Fixes: e27c41d5b0681 ("drm/amd/display: Support for DMUB HPD interrupt handling")
> > Addresses-Coverity-ID: 1493909 ("Null pointer dereference")
> > Signed-off-by: José Expósito <jose.exposito89@gmail.com>
>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>
> Harry
>
> > ---
> >  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > index e727f1dd2a9a..7fbded7a6d9c 100644
> > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > @@ -656,7 +656,7 @@ void dmub_hpd_callback(struct amdgpu_device *adev, struct dmub_notification *not
> >       struct drm_connector_list_iter iter;
> >       struct dc_link *link;
> >       uint8_t link_index = 0;
> > -     struct drm_device *dev = adev->dm.ddev;
> > +     struct drm_device *dev;
> >
> >       if (adev == NULL)
> >               return;
> > @@ -673,6 +673,7 @@ void dmub_hpd_callback(struct amdgpu_device *adev, struct dmub_notification *not
> >
> >       link_index = notify->link_index;
> >       link = adev->dm.dc->links[link_index];
> > +     dev = adev->dm.ddev;
> >
> >       drm_connector_list_iter_begin(dev, &iter);
> >       drm_for_each_connector_iter(connector, &iter) {
>

WARNING: multiple messages have this Message-ID (diff)
From: Alex Deucher <alexdeucher@gmail.com>
To: Harry Wentland <harry.wentland@amd.com>
Cc: "Anson Jacob" <Anson.Jacob@amd.com>,
	"Jude Shih" <shenshih@amd.com>, "Dave Airlie" <airlied@linux.ie>,
	"xinhui pan" <Xinhui.Pan@amd.com>,
	"Siqueira, Rodrigo" <Rodrigo.Siqueira@amd.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"amd-gfx list" <amd-gfx@lists.freedesktop.org>,
	"Christian Koenig" <christian.koenig@amd.com>,
	"Leo (Sunpeng) Li" <sunpeng.li@amd.com>,
	"Maling list - DRI developers" <dri-devel@lists.freedesktop.org>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Deucher, Alexander" <alexander.deucher@amd.com>,
	"José Expósito" <jose.exposito89@gmail.com>,
	"Kazlauskas, Nicholas" <nicholas.kazlauskas@amd.com>
Subject: Re: [PATCH] drm/amd/display: invalid parameter check in dmub_hpd_callback
Date: Mon, 10 Jan 2022 13:37:34 -0500	[thread overview]
Message-ID: <CADnq5_N1-kKfhZ9mttcRq7RON0DsEjs1cpvxo4M7jJN3M8Sx9w@mail.gmail.com> (raw)
In-Reply-To: <139784cd-6cb7-18e0-bb09-b35113bd83ef@amd.com>

Applied.  Thanks!

Alex

On Mon, Jan 10, 2022 at 11:34 AM Harry Wentland <harry.wentland@amd.com> wrote:
>
> On 2022-01-09 13:42, José Expósito wrote:
> > The function performs a check on the "adev" input parameter, however, it
> > is used before the check.
> >
> > Initialize the "dev" variable after the sanity check to avoid a possible
> > NULL pointer dereference.
> >
> > Fixes: e27c41d5b0681 ("drm/amd/display: Support for DMUB HPD interrupt handling")
> > Addresses-Coverity-ID: 1493909 ("Null pointer dereference")
> > Signed-off-by: José Expósito <jose.exposito89@gmail.com>
>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>
> Harry
>
> > ---
> >  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > index e727f1dd2a9a..7fbded7a6d9c 100644
> > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > @@ -656,7 +656,7 @@ void dmub_hpd_callback(struct amdgpu_device *adev, struct dmub_notification *not
> >       struct drm_connector_list_iter iter;
> >       struct dc_link *link;
> >       uint8_t link_index = 0;
> > -     struct drm_device *dev = adev->dm.ddev;
> > +     struct drm_device *dev;
> >
> >       if (adev == NULL)
> >               return;
> > @@ -673,6 +673,7 @@ void dmub_hpd_callback(struct amdgpu_device *adev, struct dmub_notification *not
> >
> >       link_index = notify->link_index;
> >       link = adev->dm.dc->links[link_index];
> > +     dev = adev->dm.ddev;
> >
> >       drm_connector_list_iter_begin(dev, &iter);
> >       drm_for_each_connector_iter(connector, &iter) {
>

  reply	other threads:[~2022-01-10 18:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-09 18:42 [PATCH] drm/amd/display: invalid parameter check in dmub_hpd_callback José Expósito
2022-01-09 18:42 ` José Expósito
2022-01-09 18:42 ` José Expósito
2022-01-10 16:34 ` Harry Wentland
2022-01-10 16:34   ` Harry Wentland
2022-01-10 16:34   ` Harry Wentland
2022-01-10 18:37   ` Alex Deucher [this message]
2022-01-10 18:37     ` Alex Deucher
2022-01-10 18:37     ` Alex Deucher

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=CADnq5_N1-kKfhZ9mttcRq7RON0DsEjs1cpvxo4M7jJN3M8Sx9w@mail.gmail.com \
    --to=alexdeucher@gmail.com \
    --cc=Anson.Jacob@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=jose.exposito89@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicholas.kazlauskas@amd.com \
    --cc=shenshih@amd.com \
    --cc=sunpeng.li@amd.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.