[2.6 patch] drivers/md/raid6algos.c: fix a NULL dereference

From: Adrian Bunk
Date: Thu Apr 27 2006 - 16:34:50 EST


This patch fixes a NULL dereference spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@xxxxxxxxx>

---

drivers/md/raid6algos.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

--- linux-2.6.17-rc2-mm1-full/drivers/md/raid6algos.c.old 2006-04-27 20:38:18.000000000 +0200
+++ linux-2.6.17-rc2-mm1-full/drivers/md/raid6algos.c 2006-04-27 20:41:21.000000000 +0200
@@ -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;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/