From: Wei Yongjun <weiyj.lk@gmail.com>
To: linux-ia64@vger.kernel.org
Subject: [PATCH] ia64/xen: fix return value check in xencomm_vtop()
Date: Fri, 21 Sep 2012 04:30:25 +0000 [thread overview]
Message-ID: <CAPgLHd_Z-4j0KNuwy=i0PgoyB+Q3dHCmdey58cadeoqJbnbc4w@mail.gmail.com> (raw)
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
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>
---
arch/ia64/xen/xencomm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/ia64/xen/xencomm.c b/arch/ia64/xen/xencomm.c
index 1f5d7ac..cf4752f 100644
--- a/arch/ia64/xen/xencomm.c
+++ b/arch/ia64/xen/xencomm.c
@@ -98,7 +98,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);
next reply other threads:[~2012-09-21 4:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-21 4:30 Wei Yongjun [this message]
2012-09-27 19:37 ` [PATCH] ia64/xen: fix return value check in xencomm_vtop() Tony Luck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPgLHd_Z-4j0KNuwy=i0PgoyB+Q3dHCmdey58cadeoqJbnbc4w@mail.gmail.com' \
--to=weiyj.lk@gmail.com \
--cc=linux-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).