Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Oct 2011 18:20:36 +0000 (UTC)
From:      Christian Brueffer <brueffer@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r226227 - stable/7/sys/net
Message-ID:  <201110101820.p9AIKaGi075222@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110101820.p9AIKaGi075222>