summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2006-04-14 22:43:12 +0000
committerchristos <christos@NetBSD.org>2006-04-14 22:43:12 +0000
commit24f5b2aec3aa99303d891b83d7c8bfeda94f004a (patch)
tree317e3dd51a53a0b53e22c72f5df35516c394ba39 /sys/dev/raidframe
parent4d098765d00900bef8229ef0f66453dd1281923a (diff)
Coverity CID 1127: Prevent NULL deref.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_raid5.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/raidframe/rf_raid5.c b/sys/dev/raidframe/rf_raid5.c
index aefca978dce..013e89029e5 100644
--- a/sys/dev/raidframe/rf_raid5.c
+++ b/sys/dev/raidframe/rf_raid5.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_raid5.c,v 1.16 2005/12/11 12:23:37 christos Exp $ */
+/* $NetBSD: rf_raid5.c,v 1.17 2006/04/14 22:43:12 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -33,7 +33,7 @@
*****************************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_raid5.c,v 1.16 2005/12/11 12:23:37 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_raid5.c,v 1.17 2006/04/14 22:43:12 christos Exp $");
#include <dev/raidframe/raidframevar.h>
@@ -293,7 +293,7 @@ rf_RaidFiveDagSelect(RF_Raid_t *raidPtr, RF_IoType_t type,
if (asmap->numParityFailed == 1)
*createFunc = (RF_VoidFuncPtr) rf_CreateNonRedundantWriteDAG;
else
- if (asmap->numStripeUnitsAccessed != 1 && failedPDA->numSector != layoutPtr->sectorsPerStripeUnit)
+ if (asmap->numStripeUnitsAccessed != 1 && (failedPDA == NULL || failedPDA->numSector != layoutPtr->sectorsPerStripeUnit))
*createFunc = NULL;
else
*createFunc = (RF_VoidFuncPtr) rf_CreateDegradedWriteDAG;