linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: check if hubbub is NULL in debugfs/amdgpu_dm_capabilities
@ 2025-07-17 20:48 Peter Shkenev
  2025-07-18 16:46 ` Alex Deucher
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Shkenev @ 2025-07-17 20:48 UTC (permalink / raw)
  To: alexander.deucher, amd-gfx, christian.koenig
  Cc: airlied, simona, dri-devel, linux-kernel

HUBBUB structure is not initialized on DCE hardware, so check if it is NULL
to avoid null dereference while accessing amdgpu_dm_capabilities file in
debugfs.

Signed-off-by: Peter Shkenev <mustela@erminea.space>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
index c7d13e743e6c..b726bcd18e29 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
@@ -3988,7 +3988,7 @@ static int capabilities_show(struct seq_file *m, void *unused)
 
 	struct hubbub *hubbub = dc->res_pool->hubbub;
 
-	if (hubbub->funcs->get_mall_en)
+	if (hubbub && hubbub->funcs->get_mall_en)
 		hubbub->funcs->get_mall_en(hubbub, &mall_in_use);
 
 	if (dc->cap_funcs.get_subvp_en)
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] drm/amdgpu: check if hubbub is NULL in debugfs/amdgpu_dm_capabilities
@ 2025-07-17 20:54 Peter Shkenev
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Shkenev @ 2025-07-17 20:54 UTC (permalink / raw)
  To: alexander.deucher, amd-gfx, christian.koenig
  Cc: airlied, simona, dri-devel, linux-kernel

HUBBUB structure is not initialized on DCE hardware, so check if it is NULL
to avoid null dereference while accessing amdgpu_dm_capabilities file in
debugfs.

Signed-off-by: Peter Shkenev <mustela@erminea.space>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
index c7d13e743e6c..b726bcd18e29 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
@@ -3988,7 +3988,7 @@ static int capabilities_show(struct seq_file *m, void *unused)
 
 	struct hubbub *hubbub = dc->res_pool->hubbub;
 
-	if (hubbub->funcs->get_mall_en)
+	if (hubbub && hubbub->funcs->get_mall_en)
 		hubbub->funcs->get_mall_en(hubbub, &mall_in_use);
 
 	if (dc->cap_funcs.get_subvp_en)
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu: check if hubbub is NULL in debugfs/amdgpu_dm_capabilities
  2025-07-17 20:48 Peter Shkenev
@ 2025-07-18 16:46 ` Alex Deucher
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2025-07-18 16:46 UTC (permalink / raw)
  To: Peter Shkenev
  Cc: alexander.deucher, amd-gfx, christian.koenig, airlied, simona,
	dri-devel, linux-kernel

Applied.  Thanks!

Alex

On Thu, Jul 17, 2025 at 4:58 PM Peter Shkenev <mustela@erminea.space> wrote:
>
> HUBBUB structure is not initialized on DCE hardware, so check if it is NULL
> to avoid null dereference while accessing amdgpu_dm_capabilities file in
> debugfs.
>
> Signed-off-by: Peter Shkenev <mustela@erminea.space>
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> index c7d13e743e6c..b726bcd18e29 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> @@ -3988,7 +3988,7 @@ static int capabilities_show(struct seq_file *m, void *unused)
>
>         struct hubbub *hubbub = dc->res_pool->hubbub;
>
> -       if (hubbub->funcs->get_mall_en)
> +       if (hubbub && hubbub->funcs->get_mall_en)
>                 hubbub->funcs->get_mall_en(hubbub, &mall_in_use);
>
>         if (dc->cap_funcs.get_subvp_en)
> --
> 2.50.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-18 16:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-17 20:54 [PATCH] drm/amdgpu: check if hubbub is NULL in debugfs/amdgpu_dm_capabilities Peter Shkenev
  -- strict thread matches above, loose matches on Subject: below --
2025-07-17 20:48 Peter Shkenev
2025-07-18 16:46 ` Alex Deucher

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).