[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 <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Tony Luck <tony.luck@intel.com>
This commit is contained in:
Wei Yongjun 2012-09-27 12:30:18 -07:00 committed by Tony Luck
parent 0967237ca6
commit 39c9a4ab2b

View File

@ -17,6 +17,7 @@
*/
#include <linux/mm.h>
#include <linux/err.h>
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);