mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [2.6 patch] drivers/md/raid6algos.c: fix a NULL dereference
@ 2006-04-27 20:33 Adrian Bunk
  0 siblings, 0 replies; only message in thread
From: Adrian Bunk @ 2006-04-27 20:33 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: linux-kernel

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

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 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;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-27 20:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-27 20:33 [2.6 patch] drivers/md/raid6algos.c: fix a NULL dereference Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome