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
This commit is contained in:
Konstantin Belousov 2013-08-10 20:54:15 +00:00
parent 6c6ff43fbe
commit 1f039bded4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=254191

View File

@ -346,8 +346,7 @@ update_intel(int cpu, cpuctl_update_args_t *args, struct thread *td)
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 *args, struct thread *td)
else
ret = 0;
fail:
if (ptr != NULL)
contigfree(ptr, args->size, M_CPUCTL);
free(ptr, M_CPUCTL);
return (ret);
}