* [PATCH] drm/amd/display: invalid parameter check in dmub_hpd_callback
@ 2022-01-09 18:42 ` José Expósito
0 siblings, 0 replies; 9+ messages in thread
From: José Expósito @ 2022-01-09 18:42 UTC (permalink / raw)
To: shenshih
Cc: harry.wentland, sunpeng.li, Rodrigo.Siqueira, alexander.deucher,
christian.koenig, Xinhui.Pan, airlied, daniel,
nicholas.kazlauskas, Anson.Jacob, amd-gfx, dri-devel,
linux-kernel, José Expósito
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>
---
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) {
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH] drm/amd/display: invalid parameter check in dmub_hpd_callback
@ 2022-01-09 18:42 ` José Expósito
0 siblings, 0 replies; 9+ messages in thread
From: José Expósito @ 2022-01-09 18:42 UTC (permalink / raw)
To: shenshih
Cc: Anson.Jacob, sunpeng.li, Xinhui.Pan, Rodrigo.Siqueira,
linux-kernel, amd-gfx, nicholas.kazlauskas, airlied, dri-devel,
alexander.deucher, José Expósito, christian.koenig
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>
---
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) {
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH] drm/amd/display: invalid parameter check in dmub_hpd_callback
@ 2022-01-09 18:42 ` José Expósito
0 siblings, 0 replies; 9+ messages in thread
From: José Expósito @ 2022-01-09 18:42 UTC (permalink / raw)
To: shenshih
Cc: Anson.Jacob, sunpeng.li, Xinhui.Pan, Rodrigo.Siqueira,
linux-kernel, amd-gfx, nicholas.kazlauskas, airlied, dri-devel,
daniel, alexander.deucher, José Expósito,
harry.wentland, christian.koenig
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>
---
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) {
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amd/display: invalid parameter check in dmub_hpd_callback
2022-01-09 18:42 ` José Expósito
(?)
@ 2022-01-10 16:34 ` Harry Wentland
-1 siblings, 0 replies; 9+ messages in thread
From: Harry Wentland @ 2022-01-10 16:34 UTC (permalink / raw)
To: José Expósito, shenshih
Cc: sunpeng.li, Rodrigo.Siqueira, alexander.deucher,
christian.koenig, Xinhui.Pan, airlied, daniel,
nicholas.kazlauskas, Anson.Jacob, amd-gfx, dri-devel,
linux-kernel
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) {
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amd/display: invalid parameter check in dmub_hpd_callback
@ 2022-01-10 16:34 ` Harry Wentland
0 siblings, 0 replies; 9+ messages in thread
From: Harry Wentland @ 2022-01-10 16:34 UTC (permalink / raw)
To: José Expósito, shenshih
Cc: Anson.Jacob, sunpeng.li, Xinhui.Pan, Rodrigo.Siqueira,
linux-kernel, amd-gfx, nicholas.kazlauskas, airlied, dri-devel,
alexander.deucher, christian.koenig
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) {
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amd/display: invalid parameter check in dmub_hpd_callback
@ 2022-01-10 16:34 ` Harry Wentland
0 siblings, 0 replies; 9+ messages in thread
From: Harry Wentland @ 2022-01-10 16:34 UTC (permalink / raw)
To: José Expósito, shenshih
Cc: Anson.Jacob, sunpeng.li, Xinhui.Pan, Rodrigo.Siqueira,
linux-kernel, amd-gfx, nicholas.kazlauskas, airlied, dri-devel,
daniel, alexander.deucher, christian.koenig
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) {
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amd/display: invalid parameter check in dmub_hpd_callback
2022-01-10 16:34 ` Harry Wentland
(?)
@ 2022-01-10 18:37 ` Alex Deucher
-1 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2022-01-10 18:37 UTC (permalink / raw)
To: Harry Wentland
Cc: José Expósito, Jude Shih, Anson Jacob,
Leo (Sunpeng) Li, xinhui pan, Siqueira, Rodrigo, LKML,
amd-gfx list, Kazlauskas, Nicholas, Dave Airlie,
Maling list - DRI developers, Daniel Vetter, Deucher, Alexander,
Christian Koenig
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) {
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amd/display: invalid parameter check in dmub_hpd_callback
@ 2022-01-10 18:37 ` Alex Deucher
0 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2022-01-10 18:37 UTC (permalink / raw)
To: Harry Wentland
Cc: Anson Jacob, Jude Shih, Dave Airlie, xinhui pan, Siqueira,
Rodrigo, LKML, amd-gfx list, Christian Koenig, Leo (Sunpeng) Li,
Maling list - DRI developers, Deucher, Alexander,
José Expósito, Kazlauskas, Nicholas
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) {
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/amd/display: invalid parameter check in dmub_hpd_callback
@ 2022-01-10 18:37 ` Alex Deucher
0 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2022-01-10 18:37 UTC (permalink / raw)
To: Harry Wentland
Cc: Anson Jacob, Jude Shih, Dave Airlie, xinhui pan, Siqueira,
Rodrigo, LKML, amd-gfx list, Christian Koenig, Leo (Sunpeng) Li,
Maling list - DRI developers, Daniel Vetter, Deucher, Alexander,
José Expósito, Kazlauskas, Nicholas
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) {
>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-01-10 18:37 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2022-01-10 18:37 ` Alex Deucher
2022-01-10 18:37 ` Alex Deucher
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.