From: Adrian Bunk Date: Fri, 23 Jun 2006 09:05:59 +0000 (-0700) Subject: [PATCH] drivers/md/raid6algos.c: fix a NULL dereference X-Git-Tag: v2.6.18-rc1~1081^2~27 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5d6839b75ca4a29b5e0a5595914a8715e8f746d;p=linux-2.6 [PATCH] drivers/md/raid6algos.c: fix a NULL dereference This patch fixes a NULL dereference spotted by the Coverity checker. Signed-off-by: Adrian Bunk Cc: "H. Peter Anvin" Cc: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/md/raid6algos.c b/drivers/md/raid6algos.c index 51c63c0cf1..9265761565 100644 --- a/drivers/md/raid6algos.c +++ b/drivers/md/raid6algos.c @@ -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;