From 1f039bded4e0c04ef1f2200d8acc41332370ed23 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sat, 10 Aug 2013 20:54:15 +0000 Subject: [PATCH] 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 MFC after: 1 week --- sys/dev/cpuctl/cpuctl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/dev/cpuctl/cpuctl.c b/sys/dev/cpuctl/cpuctl.c index 742ef0db8131..4e5abb291a7f 100644 --- a/sys/dev/cpuctl/cpuctl.c +++ b/sys/dev/cpuctl/cpuctl.c @@ -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); }