diff --git a/mm/mlock.c b/mm/mlock.c index c6946c91193d..0cee3f97d3df 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -837,6 +837,7 @@ int user_shm_lock(size_t size, struct ucounts *ucounts) } if (!get_ucounts(ucounts)) { dec_rlimit_ucounts(ucounts, UCOUNT_RLIMIT_MEMLOCK, locked); + allowed = 0; goto out; } allowed = 1;