From: Ingo Molnar Date: Mon, 18 Aug 2008 10:59:32 +0000 (+0200) Subject: x86, fpu: check __clear_user() return value X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9f482807a6bd7e2aa1ed0d8cfc48463ec4ca3568;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git x86, fpu: check __clear_user() return value fix warning: arch/x86/kernel/xsave.c: In function ‘save_i387_xstate’: arch/x86/kernel/xsave.c:98: warning: ignoring return value of ‘__clear_user’, declared with attribute warn_unused_result check the return value and act on it. We should not be ignoring faults at this point. Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c index 2f98323716d9..9abac8a9d823 100644 --- a/arch/x86/kernel/xsave.c +++ b/arch/x86/kernel/xsave.c @@ -95,7 +95,9 @@ int save_i387_xstate(void __user *buf) * Start with clearing the user buffer. This will present a * clean context for the bytes not touched by the fxsave/xsave. */ - __clear_user(buf, sig_xstate_size); + err = __clear_user(buf, sig_xstate_size); + if (err) + return err; if (task_thread_info(tsk)->status & TS_XSAVE) err = xsave_user(buf);