AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH next] drm/amdgpu: Fix amdgpu_ip_block_hw_fini()
@ 2024-10-24  8:17 Dan Carpenter
  2024-10-24 15:00 ` Mario Limonciello
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2024-10-24  8:17 UTC (permalink / raw)
  To: Sunil Khatri
  Cc: Alex Deucher, Christian König, Xinhui Pan, David Airlie,
	Simona Vetter, Lijo Lazar, Hawking Zhang, Mario Limonciello,
	Ma Jun, Victor Lu, Yunxiang Li, amd-gfx, dri-devel, linux-kernel,
	kernel-janitors

This NULL check is reversed so the function doesn't work.

Fixes: dad01f93f432 ("drm/amdgpu: validate hw_fini before function call")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 91c1f2188498..f12fab13386a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3309,7 +3309,7 @@ static void amdgpu_ip_block_hw_fini(struct amdgpu_ip_block *ip_block)
 {
 	int r;
 
-	if (ip_block->version->funcs->hw_fini) {
+	if (!ip_block->version->funcs->hw_fini) {
 		DRM_ERROR("hw_fini of IP block <%s> not defined\n",
 			  ip_block->version->funcs->name);
 	} else {
-- 
2.45.2


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

* Re: [PATCH next] drm/amdgpu: Fix amdgpu_ip_block_hw_fini()
  2024-10-24  8:17 [PATCH next] drm/amdgpu: Fix amdgpu_ip_block_hw_fini() Dan Carpenter
@ 2024-10-24 15:00 ` Mario Limonciello
  0 siblings, 0 replies; 2+ messages in thread
From: Mario Limonciello @ 2024-10-24 15:00 UTC (permalink / raw)
  To: Dan Carpenter, Sunil Khatri
  Cc: Alex Deucher, Christian König, Xinhui Pan, David Airlie,
	Simona Vetter, Lijo Lazar, Hawking Zhang, Ma Jun, Victor Lu,
	Yunxiang Li, amd-gfx, dri-devel, linux-kernel, kernel-janitors

On 10/24/2024 03:17, Dan Carpenter wrote:
> This NULL check is reversed so the function doesn't work.
> 
> Fixes: dad01f93f432 ("drm/amdgpu: validate hw_fini before function call")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Thanks!

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>

Also applied to amd-staging-drm-next.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 91c1f2188498..f12fab13386a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -3309,7 +3309,7 @@ static void amdgpu_ip_block_hw_fini(struct amdgpu_ip_block *ip_block)
>   {
>   	int r;
>   
> -	if (ip_block->version->funcs->hw_fini) {
> +	if (!ip_block->version->funcs->hw_fini) {
>   		DRM_ERROR("hw_fini of IP block <%s> not defined\n",
>   			  ip_block->version->funcs->name);
>   	} else {


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

end of thread, other threads:[~2024-10-25 12:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-24  8:17 [PATCH next] drm/amdgpu: Fix amdgpu_ip_block_hw_fini() Dan Carpenter
2024-10-24 15:00 ` Mario Limonciello

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox