svn commit: r226227 - stable/7/sys/net

Christian Brueffer brueffer at FreeBSD.org
Mon Oct 10 18:20:36 UTC 2011


Author: brueffer
Date: Mon Oct 10 18:20:36 2011
New Revision: 226227
URL: http://svn.freebsd.org/changeset/base/226227

Log:
  MFC: r198357
  
  Check pointer for NULL before dereferencing it, not after.

Modified:
  stable/7/sys/net/if_gif.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/net/if_gif.c
==============================================================================
--- stable/7/sys/net/if_gif.c	Mon Oct 10 18:18:40 2011	(r226226)
+++ stable/7/sys/net/if_gif.c	Mon Oct 10 18:20:36 2011	(r226227)
@@ -482,7 +482,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;
@@ -492,7 +492,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