mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fs/signalfd: fix build error for BUS_MCEERR_AR
@ 2018-02-12 21:18 Randy Dunlap
  2018-02-13  2:18 ` Eric W. Biederman
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2018-02-12 21:18 UTC (permalink / raw)
  To: LKML, Al Viro, Eric W. Biederman, Linux FS Devel; +Cc: Geert Uytterhoeven

From: Randy Dunlap <rdunlap@infradead.org>

Fix build error in fs/signalfd.c by using same method that is used in
kernel/signal.c: separate blocks for different signal si_code values.

./fs/signalfd.c: error: 'BUS_MCEERR_AR' undeclared (first use in this function)

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
---
 fs/signalfd.c |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

Applies to mainline 4.16-rc1.

--- linux-next-20180212.orig/fs/signalfd.c
+++ linux-next-20180212/fs/signalfd.c
@@ -118,13 +118,22 @@ static int signalfd_copyinfo(struct sign
 		err |= __put_user(kinfo->si_trapno, &uinfo->ssi_trapno);
 #endif
 #ifdef BUS_MCEERR_AO
-		/* 
+		/*
 		 * Other callers might not initialize the si_lsb field,
 		 * so check explicitly for the right codes here.
 		 */
 		if (kinfo->si_signo == SIGBUS &&
-		    (kinfo->si_code == BUS_MCEERR_AR ||
-		     kinfo->si_code == BUS_MCEERR_AO))
+		     kinfo->si_code == BUS_MCEERR_AO)
+			err |= __put_user((short) kinfo->si_addr_lsb,
+					  &uinfo->ssi_addr_lsb);
+#endif
+#ifdef BUS_MCEERR_AR
+		/*
+		 * Other callers might not initialize the si_lsb field,
+		 * so check explicitly for the right codes here.
+		 */
+		if (kinfo->si_signo == SIGBUS &&
+		    kinfo->si_code == BUS_MCEERR_AR)
 			err |= __put_user((short) kinfo->si_addr_lsb,
 					  &uinfo->ssi_addr_lsb);
 #endif

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-13  2:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-12 21:18 [PATCH] fs/signalfd: fix build error for BUS_MCEERR_AR Randy Dunlap
2018-02-13  2:18 ` Eric W. Biederman
2018-02-13  2:19   ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®