diff options
author | Bob Picco <bob.picco@hp.com> | 2005-11-14 01:06:35 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-14 03:14:11 +0100 |
commit | 5563e77078d85c4f107a0a673500c43ce57cf702 (patch) | |
tree | b9cacaa2f6ad595d6ade9e69f8a84d7c9b063048 /kernel | |
parent | [PATCH] nvidiafb: Fix bug in nvidiafb_pan_display (diff) | |
download | linux-5563e77078d85c4f107a0a673500c43ce57cf702.tar.xz linux-5563e77078d85c4f107a0a673500c43ce57cf702.zip |
[PATCH] cpuset: fix return without releasing semaphore
It is wrong to acquire the semaphore and then return from
cpuset_zone_allowed without releasing it.
Signed-off-by: Bob Picco <bob.picco@hp.com>
Acked-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cpuset.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 5a737ed9dac7..7430640f9816 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -1809,11 +1809,12 @@ int cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) if (gfp_mask & __GFP_HARDWALL) /* If hardwall request, stop here */ return 0; + if (current->flags & PF_EXITING) /* Let dying task have memory */ + return 1; + /* Not hardwall and node outside mems_allowed: scan up cpusets */ down(&callback_sem); - if (current->flags & PF_EXITING) /* Let dying task have memory */ - return 1; task_lock(current); cs = nearest_exclusive_ancestor(current->cpuset); task_unlock(current); |