From: sf Date: Sun, 19 Apr 2015 06:30:20 +0000 (+0000) Subject: Add a missing pmap_kremove X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ad6fa6e613a7490c2c5a2a4793aeb1d5e7ab79fe;p=openbsd Add a missing pmap_kremove Noticed by mlarkin@ --- diff --git a/sys/arch/amd64/amd64/codepatch.c b/sys/arch/amd64/amd64/codepatch.c index 4e9ed6b55a0..c0a33bbe5eb 100644 --- a/sys/arch/amd64/amd64/codepatch.c +++ b/sys/arch/amd64/amd64/codepatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: codepatch.c,v 1.1 2015/01/16 10:17:51 sf Exp $ */ +/* $OpenBSD: codepatch.c,v 1.2 2015/04/19 06:30:20 sf Exp $ */ /* * Copyright (c) 2014-2015 Stefan Fritsch * @@ -90,8 +90,10 @@ void *codepatch_maprw(vaddr_t *nva, vaddr_t dest) void codepatch_unmaprw(vaddr_t nva) { - if (nva != 0) - km_free((void *)nva, 2 * PAGE_SIZE, &kv_any, &kp_none); + if (nva == 0) + return; + pmap_kremove(nva, 2 * PAGE_SIZE); + km_free((void *)nva, 2 * PAGE_SIZE, &kv_any, &kp_none); } /* Patch with NOPs */