Check pointer for NULL before dereferencing it, not after.

PR:		138390
Submitted by:	Patroklos Argyroudis <argp@census-labs.com>
MFC after:	1 week
This commit is contained in:
Christian Brueffer 2009-10-22 06:17:04 +00:00
parent e6fa23b0da
commit 4382b0681e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=198357

View file

@ -507,7 +507,7 @@ gif_input(m, af, ifp)
struct ifnet *ifp;
{
int isr, n;
struct gif_softc *sc = ifp->if_softc;
struct gif_softc *sc;
struct etherip_header *eip;
struct ether_header *eh;
struct ifnet *oldifp;
@ -517,7 +517,7 @@ gif_input(m, af, ifp)
m_freem(m);
return;
}
sc = ifp->if_softc;
m->m_pkthdr.rcvif = ifp;
#ifdef MAC