diff options
author | Tim Deegan <tim@xen.org> | 2013-09-12 09:56:12 +0100 |
---|---|---|
committer | Tim Deegan <tim@xen.org> | 2013-09-12 17:47:08 +0100 |
commit | b5f9a29421d0d2587683e3a91f0659102e80a942 (patch) | |
tree | ea503403751e434221ca15384bb7c29e258b69a8 /xen/arch/x86 | |
parent | 06d086832155fc7f5344e9d108b979de34674d11 (diff) | |
download | xen-b5f9a29421d0d2587683e3a91f0659102e80a942.tar.gz xen-b5f9a29421d0d2587683e3a91f0659102e80a942.tar.bz2 xen-b5f9a29421d0d2587683e3a91f0659102e80a942.zip |
x86/mm: Don't dereference p2m pointer before NULL check.
Not a security bug, because in fact this is never called with a NULL
argument.
Coverity CID 1055955
Signed-off-by: Tim Deegan <tim@xen.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Diffstat (limited to 'xen/arch/x86')
-rw-r--r-- | xen/arch/x86/mm/p2m.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index f5ddd208c9..8f380ed809 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -453,7 +453,7 @@ void p2m_teardown(struct p2m_domain *p2m) * We know we don't have any extra mappings to these pages */ { struct page_info *pg; - struct domain *d = p2m->domain; + struct domain *d; unsigned long gfn; p2m_type_t t; mfn_t mfn; @@ -461,6 +461,8 @@ void p2m_teardown(struct p2m_domain *p2m) if (p2m == NULL) return; + d = p2m->domain; + p2m_lock(p2m); /* Try to unshare any remaining shared p2m entries. Safeguard |