Author: yongari
Date: Tue Nov 23 19:23:47 2010
New Revision: 215763
URL: http://svn.freebsd.org/changeset/base/215763

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

Modified:
  stable/7/sys/dev/mii/brgphy.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/dev/mii/brgphy.c
==============================================================================
--- stable/7/sys/dev/mii/brgphy.c       Tue Nov 23 19:22:44 2010        
(r215762)
+++ stable/7/sys/dev/mii/brgphy.c       Tue Nov 23 19:23:47 2010        
(r215763)
@@ -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 */
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to