Source-Changes-HG archive

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

[src/trunk]: src/sys/arch getitesp() can return NULL, so check for that in it...



details:   https://anonhg.NetBSD.org/src/rev/57fea177d7e5
branches:  trunk
changeset: 574495:57fea177d7e5
user:      chs <chs%NetBSD.org@localhost>
date:      Wed Mar 02 08:14:26 2005 +0000

description:
getitesp() can return NULL, so check for that in iteopen().
pointed out by Michael Hitch.

diffstat:

 sys/arch/amiga/dev/ite.c |  6 ++++--
 sys/arch/atari/dev/ite.c |  6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diffs (54 lines):

diff -r 22491b9171d9 -r 57fea177d7e5 sys/arch/amiga/dev/ite.c
--- a/sys/arch/amiga/dev/ite.c  Wed Mar 02 05:20:43 2005 +0000
+++ b/sys/arch/amiga/dev/ite.c  Wed Mar 02 08:14:26 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ite.c,v 1.68 2005/01/19 02:08:40 chs Exp $ */
+/*     $NetBSD: ite.c,v 1.69 2005/03/02 08:14:26 chs Exp $ */
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -83,7 +83,7 @@
 #include "opt_ddb.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.68 2005/01/19 02:08:40 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.69 2005/03/02 08:14:26 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -453,6 +453,8 @@
        if (unit >= ite_cd.cd_ndevs)
                return ENXIO;
        ip = getitesp(dev);
+       if (ip == NULL)
+               return ENXIO;
        if ((ip->flags & ITE_ATTACHED) == 0)
                return ENXIO;
 
diff -r 22491b9171d9 -r 57fea177d7e5 sys/arch/atari/dev/ite.c
--- a/sys/arch/atari/dev/ite.c  Wed Mar 02 05:20:43 2005 +0000
+++ b/sys/arch/atari/dev/ite.c  Wed Mar 02 08:14:26 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ite.c,v 1.44 2005/01/23 09:25:52 he Exp $      */
+/*     $NetBSD: ite.c,v 1.45 2005/03/02 08:14:26 chs Exp $     */
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -81,7 +81,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.44 2005/01/23 09:25:52 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.45 2005/03/02 08:14:26 chs Exp $");
 
 #include "opt_ddb.h"
 
@@ -430,6 +430,8 @@
 
        first = 0;
        ip = getitesp(dev);
+       if (ip == NULL)
+               return ENXIO;
        if ((ip->flags & ITE_ATTACHED) == 0)
                return (ENXIO);
 



Home | Main Index | Thread Index | Old Index