NetBSD-Bugs archive

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

Re: kern/51081: calling ioctl while attaching wifi device causes a jump to NULL



The following reply was made to PR kern/51081; it has been noted by GNATS.

From: coypu%SDF.ORG@localhost
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/51081: calling ioctl while attaching wifi device causes a
 jump to NULL
Date: Thu, 21 Apr 2016 15:12:27 +0000

 This seems to do the trick:
 
 diff --git a/sys/net/if_media.c b/sys/net/if_media.c
 index 3b1df50..6d42ada 100644
 --- a/sys/net/if_media.c
 +++ b/sys/net/if_media.c
 @@ -237,7 +237,7 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, struct ifmedia *ifm,
         struct oifreq *oifr = (struct oifreq *)ifr;
  #endif
  
 -       if (ifp == NULL || ifr == NULL || ifm == NULL)
 +       if (ifp == NULL || ifr == NULL || ifm == NULL || ifm->ifm_status == NULL)
                 return (EINVAL);
  
         switch (cmd) {
 


Home | Main Index | Thread Index | Old Index