diff options
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index ccdfbb16c86d..b373322ca497 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -1478,9 +1478,7 @@ static int unshare_vm(unsigned long unshare_flags, struct mm_struct **new_mmp) | |||
1478 | 1478 | ||
1479 | if ((unshare_flags & CLONE_VM) && | 1479 | if ((unshare_flags & CLONE_VM) && |
1480 | (mm && atomic_read(&mm->mm_users) > 1)) { | 1480 | (mm && atomic_read(&mm->mm_users) > 1)) { |
1481 | *new_mmp = dup_mm(current); | 1481 | return -EINVAL; |
1482 | if (!*new_mmp) | ||
1483 | return -ENOMEM; | ||
1484 | } | 1482 | } |
1485 | 1483 | ||
1486 | return 0; | 1484 | return 0; |
@@ -1569,7 +1567,7 @@ asmlinkage long sys_unshare(unsigned long unshare_flags) | |||
1569 | 1567 | ||
1570 | if (new_sigh) { | 1568 | if (new_sigh) { |
1571 | sigh = current->sighand; | 1569 | sigh = current->sighand; |
1572 | current->sighand = new_sigh; | 1570 | rcu_assign_pointer(current->sighand, new_sigh); |
1573 | new_sigh = sigh; | 1571 | new_sigh = sigh; |
1574 | } | 1572 | } |
1575 | 1573 | ||