svn commit: r198357 - head/sys/net

Christian Brueffer brueffer at FreeBSD.org
Thu Oct 22 06:17:04 UTC 2009


Author: brueffer
Date: Thu Oct 22 06:17:04 2009
New Revision: 198357
URL: http://svn.freebsd.org/changeset/base/198357

Log:
  Check pointer for NULL before dereferencing it, not after.
  
  PR:		138390
  Submitted by:	Patroklos Argyroudis <argp at census-labs.com>
  MFC after:	1 week

Modified:
  head/sys/net/if_gif.c

Modified: head/sys/net/if_gif.c
==============================================================================
--- head/sys/net/if_gif.c	Thu Oct 22 06:13:07 2009	(r198356)
+++ head/sys/net/if_gif.c	Thu Oct 22 06:17:04 2009	(r198357)
@@ -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


More information about the svn-src-all mailing list