Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Aug 2013 20:54:15 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254191 - head/sys/dev/cpuctl
Message-ID:  <201308102054.r7AKsFxZ075928@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sat Aug 10 20:54:15 2013
New Revision: 254191
URL: http://svnweb.freebsd.org/changeset/base/254191

Log:
  Match malloc(9) calls with free(9), not contigfree(9).  Also remove
  unneeded checks for NULL, free(9) can handle NULL pointers on its own,
  and the regions were allocated with M_WAITOK flag as well.
  
  Reported and tested by:	Larry Rosenman <ler@lerctr.org>
  MFC after:	1 week

Modified:
  head/sys/dev/cpuctl/cpuctl.c

Modified: head/sys/dev/cpuctl/cpuctl.c
==============================================================================
--- head/sys/dev/cpuctl/cpuctl.c	Sat Aug 10 19:38:29 2013	(r254190)
+++ head/sys/dev/cpuctl/cpuctl.c	Sat Aug 10 20:54:15 2013	(r254191)
@@ -346,8 +346,7 @@ update_intel(int cpu, cpuctl_update_args
 	else
 		ret = EEXIST;
 fail:
-	if (ptr != NULL)
-		contigfree(ptr, args->size, M_CPUCTL);
+	free(ptr, M_CPUCTL);
 	return (ret);
 }
 
@@ -476,8 +475,7 @@ update_via(int cpu, cpuctl_update_args_t
 	else
 		ret = 0;
 fail:
-	if (ptr != NULL)
-		contigfree(ptr, args->size, M_CPUCTL);
+	free(ptr, M_CPUCTL);
 	return (ret);
 }
 



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