@@ -105,11 +105,9 @@ static inline int mm_pkey_alloc(struct mm_struct *mm)
return ret;
}
-static inline int mm_pkey_free(struct mm_struct *mm, int pkey)
+static inline void mm_pkey_free(struct mm_struct *mm, int pkey)
{
__mm_pkey_free(mm, pkey);
-
- return 0;
}
/*
@@ -105,11 +105,9 @@ int mm_pkey_alloc(struct mm_struct *mm)
}
static inline
-int mm_pkey_free(struct mm_struct *mm, int pkey)
+void mm_pkey_free(struct mm_struct *mm, int pkey)
{
mm_set_pkey_free(mm, pkey);
-
- return 0;
}
static inline int vma_pkey(struct vm_area_struct *vma)
@@ -30,10 +30,7 @@ static inline int mm_pkey_alloc(struct mm_struct *mm)
return -1;
}
-static inline int mm_pkey_free(struct mm_struct *mm, int pkey)
-{
- return -EINVAL;
-}
+static inline void mm_pkey_free(struct mm_struct *mm, int pkey) { }
static inline int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
unsigned long init_val)
@@ -809,8 +809,10 @@ SYSCALL_DEFINE1(pkey_free, int, pkey)
return ret;
mmap_write_lock(current->mm);
- if (mm_pkey_is_allocated(current->mm, pkey))
- ret = mm_pkey_free(current->mm, pkey);
+ if (mm_pkey_is_allocated(current->mm, pkey)) {
+ mm_pkey_free(current->mm, pkey);
+ ret = 0;
+ }
mmap_write_unlock(current->mm);
/*