linux-ia64.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ia64/xen: fix return value check in xencomm_vtop()
@ 2012-09-21  4:30 Wei Yongjun
  2012-09-27 19:37 ` Tony Luck
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2012-09-21  4:30 UTC (permalink / raw)
  To: linux-ia64

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);



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ia64/xen: fix return value check in xencomm_vtop()
  2012-09-21  4:30 [PATCH] ia64/xen: fix return value check in xencomm_vtop() Wei Yongjun
@ 2012-09-27 19:37 ` Tony Luck
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Luck @ 2012-09-27 19:37 UTC (permalink / raw)
  To: linux-ia64

On Thu, Sep 20, 2012 at 9:30 PM, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> 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().

I added a:

#include <linux/err.h>

so that the definition of IS_ERR_OR_NULL() became visible
to xencomm.c and applied.

Thanks

-Tony

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-27 19:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-21  4:30 [PATCH] ia64/xen: fix return value check in xencomm_vtop() Wei Yongjun
2012-09-27 19:37 ` Tony Luck

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).