Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe CID 1347189: Null pointer dereferences



details:   https://anonhg.NetBSD.org/src/rev/99e38ec0a7b4
branches:  trunk
changeset: 342737:99e38ec0a7b4
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Thu Jan 07 08:58:01 2016 +0000

description:
CID 1347189:  Null pointer dereferences

diffstat:

 sys/dev/raidframe/rf_netbsdkintf.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 0ae822bac992 -r 99e38ec0a7b4 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Thu Jan 07 07:59:08 2016 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Thu Jan 07 08:58:01 2016 +0000
@@ -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 @@
        }
 
        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);



Home | Main Index | Thread Index | Old Index