mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 12:10:52 -04:00
mempolicy: ERR_PTR dereference in mpol_shared_policy_init()
The original code called mpol_put(new) while "new" was an ERR_PTR. Signed-off-by: Dan Carpenter <[email protected]> Cc: Lee Schermerhorn <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Cc: Christoph Lameter <[email protected]> Acked-by: David Rientjes <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
b1cdc4670b
commit
0cae3457b1
1 changed files with 2 additions and 1 deletions
|
|
@ -2098,7 +2098,7 @@ void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol)
|
|||
/* contextualize the tmpfs mount point mempolicy */
|
||||
new = mpol_new(mpol->mode, mpol->flags, &mpol->w.user_nodemask);
|
||||
if (IS_ERR(new))
|
||||
goto put_free; /* no valid nodemask intersection */
|
||||
goto free_scratch; /* no valid nodemask intersection */
|
||||
|
||||
task_lock(current);
|
||||
ret = mpol_set_nodemask(new, &mpol->w.user_nodemask, scratch);
|
||||
|
|
@ -2114,6 +2114,7 @@ void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol)
|
|||
|
||||
put_free:
|
||||
mpol_put(new); /* drop initial ref */
|
||||
free_scratch:
|
||||
NODEMASK_SCRATCH_FREE(scratch);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue