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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Adrian Bunk <[email protected]>

---

 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux