Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ata Stopgap crash prevention when atadebug_mask incl...



details:   https://anonhg.NetBSD.org/src/rev/54823e225182
branches:  trunk
changeset: 780205:54823e225182
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sun Jul 15 15:49:46 2012 +0000

description:
Stopgap crash prevention when atadebug_mask includes DEBUG_PROBE bit.

diffstat:

 sys/dev/ata/ata.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (33 lines):

diff -r c2c6d8a9744b -r 54823e225182 sys/dev/ata/ata.c
--- a/sys/dev/ata/ata.c Sun Jul 15 15:17:56 2012 +0000
+++ b/sys/dev/ata/ata.c Sun Jul 15 15:49:46 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ata.c,v 1.118 2012/07/15 10:55:29 dsl Exp $    */
+/*     $NetBSD: ata.c,v 1.119 2012/07/15 15:49:46 jakllsch Exp $       */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.118 2012/07/15 10:55:29 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.119 2012/07/15 15:49:46 jakllsch Exp $");
 
 #include "opt_ata.h"
 
@@ -212,9 +212,11 @@
        if (chp->ch_satapmp_nports == 0)
                (*atac->atac_probe)(chp);
 
-       ATADEBUG_PRINT(("atabusattach: ch_drive_type 0x%x 0x%x\n",
-           chp->ch_drive[0].drive_type, chp->ch_drive[1].drive_type),
-           DEBUG_PROBE);
+       if (chp->ch_drive != NULL && chp->ch_ndrives >= 1) {
+               ATADEBUG_PRINT(("atabusattach: ch_drive_type 0x%x 0x%x\n",
+                   chp->ch_drive[0].drive_type, chp->ch_drive[1].drive_type),
+                   DEBUG_PROBE);
+       }
 
        /* next operations will occurs in a separate thread */
        s = splbio();



Home | Main Index | Thread Index | Old Index