summaryrefslogtreecommitdiffstats
path: root/lib/libkvm
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2014-10-16 13:49:54 +0000
committerandrew <andrew@FreeBSD.org>2014-10-16 13:49:54 +0000
commit055b73bd726ca77c54f8372c79b8952f7bca62e7 (patch)
treed98666bcdffa84b27ed7d41a67b41b3d530c24b1 /lib/libkvm
parentcdeccc2a52da5b01d56faf640b8d9dcb278a80df (diff)
downloadFreeBSD-src-055b73bd726ca77c54f8372c79b8952f7bca62e7.zip
FreeBSD-src-055b73bd726ca77c54f8372c79b8952f7bca62e7.tar.gz
Fix the type of pte_pa as when it is passed into _kvm_pa2off it is either
a uint64_t or a pointer to an off_t. With it being a u_long can result in incorrect values being returned.
Diffstat (limited to 'lib/libkvm')
-rw-r--r--lib/libkvm/kvm_arm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libkvm/kvm_arm.c b/lib/libkvm/kvm_arm.c
index d221f6a..ceff383 100644
--- a/lib/libkvm/kvm_arm.c
+++ b/lib/libkvm/kvm_arm.c
@@ -212,7 +212,7 @@ _kvm_kvatop(kvm_t *kd, u_long va, off_t *pa)
struct vmstate *vm = kd->vmst;
pd_entry_t pd;
pt_entry_t pte;
- u_long pte_pa;
+ off_t pte_pa;
if (kd->vmst->minidump)
return (_kvm_minidump_kvatop(kd, va, pa));
@@ -228,7 +228,7 @@ _kvm_kvatop(kvm_t *kd, u_long va, off_t *pa)
return (_kvm_pa2off(kd, *pa, pa, L1_S_SIZE));
}
pte_pa = (pd & L1_ADDR_MASK) + l2pte_index(va) * sizeof(pte);
- _kvm_pa2off(kd, pte_pa, (off_t *)&pte_pa, L1_S_SIZE);
+ _kvm_pa2off(kd, pte_pa, &pte_pa, L1_S_SIZE);
if (lseek(kd->pmfd, pte_pa, 0) == -1) {
_kvm_syserr(kd, kd->program, "_kvm_kvatop: lseek");
goto invalid;
OpenPOWER on IntegriCloud