Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/scsipi Reset variable error to 0 before handle each ...



details:   https://anonhg.NetBSD.org/src/rev/070119f771bb
branches:  trunk
changeset: 790206:070119f771bb
user:      kiyohara <kiyohara%NetBSD.org@localhost>
date:      Thu Sep 26 16:00:54 2013 +0000

description:
Reset variable error to 0 before handle each ioctl cmd.  Or returns EPASSTHROUGH
when some cmds. (e.g. ODIOCGDINFO)

diffstat:

 sys/dev/scsipi/sd.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r e87d4e21a6fe -r 070119f771bb sys/dev/scsipi/sd.c
--- a/sys/dev/scsipi/sd.c       Thu Sep 26 10:31:02 2013 +0000
+++ b/sys/dev/scsipi/sd.c       Thu Sep 26 16:00:54 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sd.c,v 1.301 2013/06/13 00:55:01 tls Exp $     */
+/*     $NetBSD: sd.c,v 1.302 2013/09/26 16:00:54 kiyohara Exp $        */
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.301 2013/06/13 00:55:01 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.302 2013/09/26 16:00:54 kiyohara Exp $");
 
 #include "opt_scsi.h"
 
@@ -1040,6 +1040,7 @@
        if (error != EPASSTHROUGH)
                return (error);
 
+       error = 0;
        switch (cmd) {
        case DIOCGDINFO:
                *(struct disklabel *)addr = *(sd->sc_dk.dk_label);
@@ -1202,8 +1203,7 @@
                                sd->flags &= ~SDF_FLUSHING;
                        else
                                sd->flags &= ~(SDF_FLUSHING|SDF_DIRTY);
-               } else
-                       error = 0;
+               }
                return (error);
 
        case DIOCAWEDGE:



Home | Main Index | Thread Index | Old Index