Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Apr 2016 09:20:29 +0000 (UTC)
From:      Sepherosa Ziehau <sephe@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r297913 - in head/sys/dev/hyperv: netvsc storvsc
Message-ID:  <201604130920.u3D9KTVv071995@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sephe
Date: Wed Apr 13 09:20:29 2016
New Revision: 297913
URL: https://svnweb.freebsd.org/changeset/base/297913

Log:
  hyperv: device_get_softc does not return NULL
  
  MFC after:	1 week
  Sponsored by:	Microsoft OSTC

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

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c	Wed Apr 13 07:04:04 2016	(r297912)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c	Wed Apr 13 09:20:29 2016	(r297913)
@@ -418,9 +418,6 @@ netvsc_attach(device_t dev)
 #endif
 
 	sc = device_get_softc(dev);
-	if (sc == NULL) {
-		return (ENOMEM);
-	}
 
 	bzero(sc, sizeof(hn_softc_t));
 	sc->hn_unit = unit;
@@ -1169,10 +1166,6 @@ netvsc_linkstatus_callback(struct hv_dev
 {
 	hn_softc_t *sc = device_get_softc(device_obj->device);
 
-	if (sc == NULL) {
-		return;
-	}
-
 	if (status == 1) {
 		sc->hn_carrier = 1;
 	} else {

Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
==============================================================================
--- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c	Wed Apr 13 07:04:04 2016	(r297912)
+++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c	Wed Apr 13 09:20:29 2016	(r297913)
@@ -293,9 +293,6 @@ get_stor_device(struct hv_device *device
 	struct storvsc_softc *sc;
 
 	sc = device_get_softc(device->device);
-	if (sc == NULL) {
-		return NULL;
-	}
 
 	if (outbound) {
 		/*
@@ -976,10 +973,6 @@ storvsc_attach(device_t dev)
 	root_mount_token = root_mount_hold("storvsc");
 
 	sc = device_get_softc(dev);
-	if (sc == NULL) {
-		ret = ENOMEM;
-		goto cleanup;
-	}
 
 	stor_type = storvsc_get_storage_type(dev);
 



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