Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Nov 2010 19:21:44 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r215761 - stable/8/sys/dev/mii
Message-ID:  <201011231921.oANJLi2x040506@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Tue Nov 23 19:21:44 2010
New Revision: 215761
URL: http://svn.freebsd.org/changeset/base/215761

Log:
  MFC r215353,215355:
  r215353:
    Plug memory leakage introduced in r204989.
  
    Reported by:	yongari
  r215355:
    Restore the previous behaviour of substring match.

Modified:
  stable/8/sys/dev/mii/brgphy.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/mii/brgphy.c
==============================================================================
--- stable/8/sys/dev/mii/brgphy.c	Tue Nov 23 19:14:17 2010	(r215760)
+++ stable/8/sys/dev/mii/brgphy.c	Tue Nov 23 19:21:44 2010	(r215761)
@@ -153,15 +153,19 @@ static int
 detect_hs21(struct bce_softc *bce_sc)
 {
 	char *sysenv;
+	int found;
 
-	if (bce_sc->bce_chipid != HS21_BCM_CHIPID)
-		return (0);
-	sysenv = getenv("smbios.system.product");
-	if (sysenv == NULL)
-		return (0);
-	if (strncmp(sysenv, HS21_PRODUCT_ID, strlen(HS21_PRODUCT_ID)) != 0)
-		return (0);
-	return (1);
+	found = 0;
+	if (bce_sc->bce_chipid == HS21_BCM_CHIPID) {
+		sysenv = getenv("smbios.system.product");
+		if (sysenv != NULL) {
+			if (strncmp(sysenv, HS21_PRODUCT_ID,
+			    strlen(HS21_PRODUCT_ID)) == 0)
+				found = 1;
+			freeenv(sysenv);
+		}
+	}
+	return (found);
 }
 
 /* Search for our PHY in the list of known PHYs */



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