Skip to contentSkip to conversation

kernel/module.c: removed dead code

PATCH New Jayachandran C. 1 participant 1 message Oct 19, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel/module.c: removed dead code

This patch fixes an issue reported by Coverity in kernel/module.c

Error reported: Cannot reach this line of code "else return ptr;"

Patch description:
This is the error path, so 'err' will be negative, the else case is not required, this patch removes it.

Signed-off-by Jayachandran C. <c.jayachandran at gmail.com>

---

 module.c |    3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)
kernel/module.c +1 -2
@@ -1853,8 +1853,7 @@
 	kfree(args);
  free_hdr:
 	vfree(hdr);
-	if (err < 0) return ERR_PTR(err);
-	else return ptr;
+	return ERR_PTR(err);
 
  truncated:
 	printk(KERN_ERR "Module len %lu truncated\n", len);