Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic don't call if_deactivate with NULL ifp.



details:   https://anonhg.NetBSD.org/src/rev/b74c3c874594
branches:  trunk
changeset: 484123:b74c3c874594
user:      itojun <itojun%NetBSD.org@localhost>
date:      Sun Mar 26 10:09:33 2000 +0000

description:
don't call if_deactivate with NULL ifp.
sc->sc_ifp can be NULL if awi_pcmcia_attach() fails, so you will see panic
if you remove a card which fails on attach.

diffstat:

 sys/dev/ic/awi.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r bdd9b680c134 -r b74c3c874594 sys/dev/ic/awi.c
--- a/sys/dev/ic/awi.c  Sun Mar 26 10:01:32 2000 +0000
+++ b/sys/dev/ic/awi.c  Sun Mar 26 10:09:33 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: awi.c,v 1.12 2000/03/23 05:26:00 mycroft Exp $ */
+/*     $NetBSD: awi.c,v 1.13 2000/03/26 10:09:33 itojun Exp $  */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -397,7 +397,8 @@
 
        case DVACT_DEACTIVATE:
                sc->sc_invalid = 1;
-               if_deactivate(sc->sc_ifp);
+               if (sc->sc_ifp)
+                       if_deactivate(sc->sc_ifp);
                break;
        }
        splx(s);



Home | Main Index | Thread Index | Old Index