summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mm/mempolicy.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index b4a039d779b0..fb678a7254f0 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -896,12 +896,15 @@ static void get_policy_nodemask(struct mempolicy *p, nodemask_t *nodes)
static int lookup_node(struct mm_struct *mm, unsigned long addr)
{
- struct page *p;
+ struct page *p = NULL;
int err;
int locked = 1;
err = get_user_pages_locked(addr & PAGE_MASK, 1, 0, &p, &locked);
- if (err >= 0) {
+ if (err == 0) {
+ /* E.g. GUP interrupted by fatal signal */
+ err = -EFAULT;
+ } else if (err > 0) {
err = page_to_nid(p);
put_page(p);
}