Skip to content

Commit

Permalink
[PATCH] drivers/md/raid6algos.c: fix a NULL dereference
Browse files Browse the repository at this point in the history
This patch fixes a NULL dereference spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Adrian Bunk authored and Linus Torvalds committed Jun 23, 2006
1 parent 226a6b8 commit a5d6839
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/md/raid6algos.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,14 @@ int __init raid6_select_algo(void)
}
}

if ( best )
if (best) {
printk("raid6: using algorithm %s (%ld MB/s)\n",
best->name,
(bestperf*HZ) >> (20-16+RAID6_TIME_JIFFIES_LG2));
else
raid6_call = *best;
} else
printk("raid6: Yikes! No algorithm found!\n");

raid6_call = *best;

free_pages((unsigned long)syndromes, 1);

return best ? 0 : -EINVAL;
Expand Down

0 comments on commit a5d6839

Please sign in to comment.