Skip to content

Commit

Permalink
[PATCH] kernel/module.c: removed dead code
Browse files Browse the repository at this point in the history
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@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jayachandran C authored and Linus Torvalds committed Jan 6, 2006
1 parent 066bb8d commit 6fe2e70
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1854,8 +1854,7 @@ static struct module *load_module(void __user *umod,
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);
Expand Down

0 comments on commit 6fe2e70

Please sign in to comment.