lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1427814281-18192-1-git-send-email-Aravind.Gopalakrishnan@amd.com>
Date:	Tue, 31 Mar 2015 10:04:41 -0500
From:	Aravind Gopalakrishnan <Aravind.Gopalakrishnan@....com>
To:	<tglx@...utronix.de>, <mingo@...hat.com>, <hpa@...or.com>,
	<tony.luck@...el.com>, <bp@...en8.de>, <x86@...nel.org>,
	<linux-kernel@...r.kernel.org>, <linux-edac@...r.kernel.org>
CC:	Aravind Gopalakrishnan <Aravind.Gopalakrishnan@....com>
Subject: [PATCH] x86, mce, severity: Fix warning about intended braces

Dan reported compiler warnings about intended curly braces
around if (!(m->mcgstatus & MCG_STATUS_RIPV)).
This can be fixed by reindenting return MCE_AR_SEVERITY
correctly to single tab.

While at it, chain ctx == IN_KERNEL check with mcgstatus
check to make it cleaner as suggested by Boris.

No functional changes are introduced by the patch

Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@....com>
---
 arch/x86/kernel/cpu/mcheck/mce-severity.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce-severity.c b/arch/x86/kernel/cpu/mcheck/mce-severity.c
index 155c926..8329c6b 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-severity.c
+++ b/arch/x86/kernel/cpu/mcheck/mce-severity.c
@@ -208,12 +208,12 @@ static int mce_severity_amd(struct mce *m, int tolerant, char **msg, bool is_exc
 		 */
 		if (mce_flags.overflow_recov) {
 			/* software can try to contain */
-			if (!(m->mcgstatus & MCG_STATUS_RIPV))
-				if (ctx == IN_KERNEL)
-					return MCE_PANIC_SEVERITY;
+			if (!(m->mcgstatus & MCG_STATUS_RIPV) &&
+			      ctx == IN_KERNEL)
+				return MCE_PANIC_SEVERITY;
 
-				/* kill current process */
-				return MCE_AR_SEVERITY;
+			/* kill current process */
+			return MCE_AR_SEVERITY;
 		} else {
 			/* at least one error was not logged */
 			if (m->status & MCI_STATUS_OVER)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ