From owner-svn-src-all@FreeBSD.ORG Fri Jan 22 17:08:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C3A1106568B; Fri, 22 Jan 2010 17:08:05 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A5938FC1C; Fri, 22 Jan 2010 17:08:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0MH85CY032057; Fri, 22 Jan 2010 17:08:05 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0MH85ib032055; Fri, 22 Jan 2010 17:08:05 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001221708.o0MH85ib032055@svn.freebsd.org> From: Christian Brueffer Date: Fri, 22 Jan 2010 17:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202816 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 17:08:05 -0000 Author: brueffer Date: Fri Jan 22 17:08:05 2010 New Revision: 202816 URL: http://svn.freebsd.org/changeset/base/202816 Log: MFC: r201848 Free allocated sbufs before returning ENOMEM. Modified: stable/7/sys/kern/kern_cpu.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/kern/kern_cpu.c ============================================================================== --- stable/7/sys/kern/kern_cpu.c Fri Jan 22 17:03:49 2010 (r202815) +++ stable/7/sys/kern/kern_cpu.c Fri Jan 22 17:08:05 2010 (r202816) @@ -926,8 +926,10 @@ cpufreq_levels_sysctl(SYSCTL_HANDLER_ARG /* Get settings from the device and generate the output string. */ count = CF_MAX_LEVELS; levels = malloc(count * sizeof(*levels), M_TEMP, M_NOWAIT); - if (levels == NULL) + if (levels == NULL) { + sbuf_delete(&sb); return (ENOMEM); + } error = CPUFREQ_LEVELS(sc->dev, levels, &count); if (error) { if (error == E2BIG) @@ -965,8 +967,10 @@ cpufreq_settings_sysctl(SYSCTL_HANDLER_A /* Get settings from the device and generate the output string. */ set_count = MAX_SETTINGS; sets = malloc(set_count * sizeof(*sets), M_TEMP, M_NOWAIT); - if (sets == NULL) + if (sets == NULL) { + sbuf_delete(&sb); return (ENOMEM); + } error = CPUFREQ_DRV_SETTINGS(dev, sets, &set_count); if (error) goto out;