From: Wei Yongjun Date: Thu, 27 Sep 2012 19:30:18 +0000 (-0700) Subject: [IA64] xen: Fix return value check in xencomm_vtop() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=39c9a4ab2b91bff26801c86e423ef07fb705b3c0;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [IA64] xen: Fix return value check in xencomm_vtop() In case of error, the function follow_page() returns ERR_PTR() or NULL pointer. The NULL test in the error handling should be replaced with IS_ERR_OR_NULL(). dpatch engine is used to auto generated this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun Signed-off-by: Tony Luck --- diff --git a/arch/ia64/xen/xencomm.c b/arch/ia64/xen/xencomm.c index 1f5d7ac82e97..73d903ca2d64 100644 --- a/arch/ia64/xen/xencomm.c +++ b/arch/ia64/xen/xencomm.c @@ -17,6 +17,7 @@ */ #include +#include static unsigned long kernel_virtual_offset; static int is_xencomm_initialized; @@ -98,7 +99,7 @@ xencomm_vtop(unsigned long vaddr) /* We assume the page is modified. */ page = follow_page(vma, vaddr, FOLL_WRITE | FOLL_TOUCH); - if (!page) + if (IS_ERR_OR_NULL(page)) return ~0UL; return (page_to_pfn(page) << PAGE_SHIFT) | (vaddr & ~PAGE_MASK);