diff options
| author | mlelstv <mlelstv@NetBSD.org> | 2016-01-07 08:58:01 +0000 |
|---|---|---|
| committer | mlelstv <mlelstv@NetBSD.org> | 2016-01-07 08:58:01 +0000 |
| commit | 8b4c95d022d715a1eb0f6f201cd8cd8a2c7ee8ff (patch) | |
| tree | a08cddd6371446794702e42adc3dbe25f1bb81e0 /sys/dev/raidframe | |
| parent | 1e549ba0646a978cd132f1a61fc6891ae774bc95 (diff) | |
CID 1347189: Null pointer dereferences
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_netbsdkintf.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index 294b156d747..27c5ebb5fb4 100644 --- a/sys/dev/raidframe/rf_netbsdkintf.c +++ b/sys/dev/raidframe/rf_netbsdkintf.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_netbsdkintf.c,v 1.341 2016/01/06 17:40:50 christos Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.342 2016/01/07 08:58:01 mlelstv Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc. @@ -101,7 +101,7 @@ ***********************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.341 2016/01/06 17:40:50 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.342 2016/01/07 08:58:01 mlelstv Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -725,6 +725,10 @@ raid_dumpblocks(device_t dev, void *va, daddr_t blkno, int nblk) } bdev = bdevsw_lookup(raidPtr->Disks[dumpto].dev); + if (bdev == NULL) { + error = ENXIO; + goto out; + } error = (*bdev->d_dump)(raidPtr->Disks[dumpto].dev, blkno, va, nblk * raidPtr->bytesPerSector); |
