Source-Changes-HG archive

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

[src-draft/trunk]: src/sys/dev/usb Avoid a null dereference.



details:   https://anonhg.NetBSD.org/src-all/rev/ac0b7ae87b55
branches:  trunk
changeset: 374993:ac0b7ae87b55
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Sun Aug 16 04:55:23 2020 +1000

description:
Avoid a null dereference.

diffstat:

 sys/dev/usb/if_urtwn.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r e44217e59406 -r ac0b7ae87b55 sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Sat Aug 15 19:51:51 2020 +1000
+++ b/sys/dev/usb/if_urtwn.c    Sun Aug 16 04:55:23 2020 +1000
@@ -5858,7 +5858,8 @@ urtwn_reset(struct ieee80211vap *vap, u_
        if (ic->ic_opmode != IEEE80211_M_MONITOR)
                return ENETRESET;
 
-       urtwn_set_chan(sc, ic->ic_curchan);
+       if (ic->ic_curchan != NULL)
+               urtwn_set_chan(sc, ic->ic_curchan);
 
        return 0;
 }



Home | Main Index | Thread Index | Old Index