Skip to contentSkip to conversation

drm/amdkfd: Fix Unchecked Return Value

PATCH In review Sunday Clement 2 participants 2 messages Oct 24, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdkfd: Fix Unchecked Return Value

Properly check the return values for function, as done elsewhere.

---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +5 -3
index 6e7bc983fc0b..3b696c58c530 100644
@@ -1897,6 +1897,8 @@ static int start_cpsch(struct device_queue_manager *dqm)
 
 static int stop_cpsch(struct device_queue_manager *dqm)
 {
+	int ret = 0;
+
 	dqm_lock(dqm);
 	if (!dqm->sched_running) {
 		dqm_unlock(dqm);
@@ -1904,9 +1906,9 @@ static int stop_cpsch(struct device_queue_manager *dqm)
 	}
 
 	if (!dqm->dev->kfd->shared_resources.enable_mes)
-		unmap_queues_cpsch(dqm, KFD_UNMAP_QUEUES_FILTER_ALL_QUEUES, 0, USE_DEFAULT_GRACE_PERIOD, false);
+		ret = unmap_queues_cpsch(dqm, KFD_UNMAP_QUEUES_FILTER_ALL_QUEUES, 0, USE_DEFAULT_GRACE_PERIOD, false);
 	else
-		remove_all_kfd_queues_mes(dqm);
+		ret = remove_all_kfd_queues_mes(dqm);
 
 	dqm->sched_running = false;
 
@@ -1920,7 +1922,7 @@ static int stop_cpsch(struct device_queue_manager *dqm)
 	dqm->detect_hang_info = NULL;
 	dqm_unlock(dqm);
 
-	return 0;
+	return ret;
 }
 
 static int create_kernel_queue_cpsch(struct device_queue_manager *dqm,
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw

[Public]

-----Original Message-----
From: Clement, Sunday <[email protected]>
Sent: Friday, October 24, 2025 2:38 PM
To: [email protected]
Cc: Kasiviswanathan, Harish <[email protected]>; Kuehling, Felix <[email protected]>; Yang, Philip <[email protected]>; Clement, Sunday <[email protected]>
Subject: [PATCH] drm/amdkfd: Fix Unchecked Return Value

Properly check the return values for function, as done elsewhere.

---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +5 -3
index 6e7bc983fc0b..3b696c58c530 100644
@@ -1897,6 +1897,8 @@ static int start_cpsch(struct device_queue_manager *dqm)
 
 static int stop_cpsch(struct device_queue_manager *dqm)
 {
+       int ret = 0;
+
        dqm_lock(dqm);
        if (!dqm->sched_running) {
                dqm_unlock(dqm);
@@ -1904,9 +1906,9 @@ static int stop_cpsch(struct device_queue_manager *dqm)
        }
 
        if (!dqm->dev->kfd->shared_resources.enable_mes)
-               unmap_queues_cpsch(dqm, KFD_UNMAP_QUEUES_FILTER_ALL_QUEUES, 0, USE_DEFAULT_GRACE_PERIOD, false);
+               ret = unmap_queues_cpsch(dqm, KFD_UNMAP_QUEUES_FILTER_ALL_QUEUES, 0, USE_DEFAULT_GRACE_PERIOD, false);
        else
-               remove_all_kfd_queues_mes(dqm);
+               ret = remove_all_kfd_queues_mes(dqm);
 
        dqm->sched_running = false;
 
@@ -1920,7 +1922,7 @@ static int stop_cpsch(struct device_queue_manager *dqm)
        dqm->detect_hang_info = NULL;
        dqm_unlock(dqm);
 
-       return 0;
+       return ret;
 }
 
 static int create_kernel_queue_cpsch(struct device_queue_manager *dqm,

--
2.43.0