Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 May 2016 17:00:45 +0000 (UTC)
From:      Sean Bruno <sbruno@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r299188 - head/sys/dev/e1000
Message-ID:  <201605061700.u46H0jJK032749@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sbruno
Date: Fri May  6 17:00:45 2016
New Revision: 299188
URL: https://svnweb.freebsd.org/changeset/base/299188

Log:
  Since igb_detach() cleans up all the data structures that will be
  free'd by the functions following its call, we can simply return instead
  of crashing and burning in the event of igb_detach() failing.
  
  PR:		197139
  Submitted by:	rupavath@juniper.net
  MFC after:	2 weeks

Modified:
  head/sys/dev/e1000/if_igb.c

Modified: head/sys/dev/e1000/if_igb.c
==============================================================================
--- head/sys/dev/e1000/if_igb.c	Fri May  6 16:59:04 2016	(r299187)
+++ head/sys/dev/e1000/if_igb.c	Fri May  6 17:00:45 2016	(r299188)
@@ -659,7 +659,8 @@ igb_attach(device_t dev)
 	return (0);
 
 err_late:
-	igb_detach(dev);
+	if (igb_detach(dev) == 0) /* igb_detach() already did the cleanup */
+		return(error);
 	igb_free_transmit_structures(adapter);
 	igb_free_receive_structures(adapter);
 	igb_release_hw_control(adapter);



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