Skip to contentSkip to conversation

drm/amd/ras: Fix a NULL vs IS_ERR() bug in ras_process_init()

PATCH New Dan Carpenter 1 participant 1 message Oct 22, 2025

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

PATCH 1/1 drm/amd/ras: Fix a NULL vs IS_ERR() bug in ras_process_init()

The kthread_run() function never returns NULL, it returns error pointers. Fix the error checking to match.

Fixes ea61341b9014 ("drm/amd/ras: Add thread to handle ras events")
---
 drivers/gpu/drm/amd/ras/rascore/ras_process.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/ras/rascore/ras_process.c +2 -2
index 02f0657f78a3..1d2f136fbe2b 100644
@@ -241,9 +241,9 @@ int ras_process_init(struct ras_core_context *ras_core)
 
 	ras_proc->ras_process_thread = kthread_run(ras_process_thread,
 							(void *)ras_core, "ras_process_thread");
-	if (!ras_proc->ras_process_thread) {
+	if (IS_ERR(ras_proc->ras_process_thread)) {
 		RAS_DEV_ERR(ras_core->dev, "Failed to create ras_process_thread.\n");
-		ret =  -ENOMEM;
+		ret = PTR_ERR(ras_proc->ras_process_thread);
 		goto err;
 	}
 
Signature · 1 line
2.51.0