Skip to contentSkip to conversation

powerpc/crash: remove unnecessary NULL check before kvfree()

PATCH Applied Sourabh Jain 2 participants 2 messages May 2, 2024 – May 7, 2024 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/crash: remove unnecessary NULL check before kvfree()

Fix the following coccicheck build warning:

arch/powerpc/kexec/crash.c:488:2-8: WARNING: NULL check before some freeing functions is not needed.

---
 arch/powerpc/kexec/crash.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/powerpc/kexec/crash.c +1 -2
index 21b193e938a3..9ac3266e4965 100644
@@ -484,8 +484,7 @@ static void update_crash_elfcorehdr(struct kimage *image, struct memory_notify *
 	}
 out:
 	kvfree(cmem);
-	if (elfbuf)
-		kvfree(elfbuf);
+	kvfree(elfbuf);
 }
 
 /**
Signature · 1 line
2.44.0