All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] lib/test_hmm: check page after calling xa_untag_pointer()
@ 2021-05-26 14:05 Yang Yingliang
  2021-05-26 19:59 ` Ralph Campbell
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2021-05-26 14:05 UTC (permalink / raw)
  To: linux-kernel, linux-mm; +Cc: jglisse, apopple, sfr

Check page after calling xa_untag_pointer() to fix compile warning:
  lib/test_hmm.c:631:16: warning: variable ‘page’ set but not used [-Wunused-but-set-variable]
  631 |   struct page *page;
      |                ^~~~

Fixes: 8b2a105c3794 ("mm: selftests for exclusive device memory")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 lib/test_hmm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/test_hmm.c b/lib/test_hmm.c
index 74d69f87691e..87db37e51d7b 100644
--- a/lib/test_hmm.c
+++ b/lib/test_hmm.c
@@ -632,7 +632,7 @@ static int dmirror_check_atomic(struct dmirror *dmirror, unsigned long start,
 
 		entry = xa_load(&dmirror->pt, pfn);
 		page = xa_untag_pointer(entry);
-		if (xa_pointer_tag(entry) == DPT_XA_TAG_ATOMIC)
+		if (!page || xa_pointer_tag(entry) == DPT_XA_TAG_ATOMIC)
 			return -EPERM;
 	}
 
-- 
2.25.1


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

* Re: [PATCH -next] lib/test_hmm: check page after calling xa_untag_pointer()
  2021-05-26 14:05 [PATCH -next] lib/test_hmm: check page after calling xa_untag_pointer() Yang Yingliang
@ 2021-05-26 19:59 ` Ralph Campbell
  0 siblings, 0 replies; 2+ messages in thread
From: Ralph Campbell @ 2021-05-26 19:59 UTC (permalink / raw)
  To: Yang Yingliang, linux-kernel, linux-mm; +Cc: jglisse, apopple, sfr

On 5/26/21 7:05 AM, Yang Yingliang wrote:

> Check page after calling xa_untag_pointer() to fix compile warning:
>    lib/test_hmm.c:631:16: warning: variable ‘page’ set but not used [-Wunused-but-set-variable]
>    631 |   struct page *page;
>        |                ^~~~
>
> Fixes: 8b2a105c3794 ("mm: selftests for exclusive device memory")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Ralph Campbell <rcampbell@nvidia.com>


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

end of thread, other threads:[~2021-05-26 19:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26 14:05 [PATCH -next] lib/test_hmm: check page after calling xa_untag_pointer() Yang Yingliang
2021-05-26 19:59 ` Ralph Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.