diff options
Diffstat (limited to 'arch/mips/kernel/signal.c')
-rw-r--r-- | arch/mips/kernel/signal.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index 2f285abc76d5..5199563c4403 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c | |||
@@ -71,8 +71,9 @@ static int protected_save_fp_context(struct sigcontext __user *sc) | |||
71 | int err; | 71 | int err; |
72 | while (1) { | 72 | while (1) { |
73 | lock_fpu_owner(); | 73 | lock_fpu_owner(); |
74 | own_fpu_inatomic(1); | 74 | err = own_fpu_inatomic(1); |
75 | err = save_fp_context(sc); /* this might fail */ | 75 | if (!err) |
76 | err = save_fp_context(sc); /* this might fail */ | ||
76 | unlock_fpu_owner(); | 77 | unlock_fpu_owner(); |
77 | if (likely(!err)) | 78 | if (likely(!err)) |
78 | break; | 79 | break; |
@@ -91,8 +92,9 @@ static int protected_restore_fp_context(struct sigcontext __user *sc) | |||
91 | int err, tmp __maybe_unused; | 92 | int err, tmp __maybe_unused; |
92 | while (1) { | 93 | while (1) { |
93 | lock_fpu_owner(); | 94 | lock_fpu_owner(); |
94 | own_fpu_inatomic(0); | 95 | err = own_fpu_inatomic(0); |
95 | err = restore_fp_context(sc); /* this might fail */ | 96 | if (!err) |
97 | err = restore_fp_context(sc); /* this might fail */ | ||
96 | unlock_fpu_owner(); | 98 | unlock_fpu_owner(); |
97 | if (likely(!err)) | 99 | if (likely(!err)) |
98 | break; | 100 | break; |