xen/arm: p2m: Check for p2m->domain to be initialized before releasing resources
authorOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Mon, 28 Aug 2017 17:32:26 +0000 (20:32 +0300)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 15 Sep 2017 21:29:09 +0000 (14:29 -0700)
commitabd91b2a2bcd05618a71f7e5fe571dd10a5727bc
treeb968a51d861f9e59ef5be6a1895fcd0ac8b27985
parentb1f1e492cd4231a1e9feedb7a35c62c063f7c510
xen/arm: p2m: Check for p2m->domain to be initialized before releasing resources

Since p2m_teardown() can be called when p2m_init() haven't executed yet
we might deal with unitialized list "p2m->pages" which leads to crash.
To avoid this use back pointer to domain as end-of-initialization indicator.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/p2m.c