Date: Tue, 23 Nov 2010 19:23:47 +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-7@freebsd.org Subject: svn commit: r215763 - stable/7/sys/dev/mii Message-ID: <201011231923.oANJNl2T040672@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011231923.oANJNl2T040672>