svn commit: r257369 - head/sys/dev/hyperv/netvsc

Xin LI delphij at FreeBSD.org
Tue Oct 29 22:42:30 UTC 2013


Author: delphij
Date: Tue Oct 29 22:42:30 2013
New Revision: 257369
URL: http://svnweb.freebsd.org/changeset/base/257369

Log:
  Don't reference pointer before testing whether it is
  NULL.
  
  Submitted by:	Clement Lecigne <clecigne google com>
  Reviewed by:	grehan
  MFC after:	3 days

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c	Tue Oct 29 21:08:20 2013	(r257368)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c	Tue Oct 29 22:42:30 2013	(r257369)
@@ -621,13 +621,15 @@ netvsc_recv(struct hv_device *device_ctx
 {
 	hn_softc_t *sc = (hn_softc_t *)device_get_softc(device_ctx->device);
 	struct mbuf *m_new;
-	struct ifnet *ifp = sc->hn_ifp;
+	struct ifnet *ifp;
 	int size;
 	int i;
 
 	if (sc == NULL) {
 		return (0); /* TODO: KYS how can this be! */
 	}
+
+	ifp = sc->hn_ifp;
 	
 	ifp = sc->arpcom.ac_ifp;
 


More information about the svn-src-head mailing list