svn commit: r254191 - head/sys/dev/cpuctl

Konstantin Belousov kib at FreeBSD.org
Sat Aug 10 20:54:15 UTC 2013


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 at 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);
 }
 


More information about the svn-src-head mailing list