Commit 39c9a4ab2b91bff26801c86e423ef07fb705b3c0
Committed by
Tony Luck
1 parent
0967237ca6
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
[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>
Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff
arch/ia64/xen/xencomm.c
... | ... | @@ -17,6 +17,7 @@ |
17 | 17 | */ |
18 | 18 | |
19 | 19 | #include <linux/mm.h> |
20 | +#include <linux/err.h> | |
20 | 21 | |
21 | 22 | static unsigned long kernel_virtual_offset; |
22 | 23 | static int is_xencomm_initialized; |
... | ... | @@ -98,7 +99,7 @@ |
98 | 99 | |
99 | 100 | /* We assume the page is modified. */ |
100 | 101 | page = follow_page(vma, vaddr, FOLL_WRITE | FOLL_TOUCH); |
101 | - if (!page) | |
102 | + if (IS_ERR_OR_NULL(page)) | |
102 | 103 | return ~0UL; |
103 | 104 | |
104 | 105 | return (page_to_pfn(page) << PAGE_SHIFT) | (vaddr & ~PAGE_MASK); |