Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5cdb579 authored by Paolo 'Blaisorblade' Giarrusso's avatar Paolo 'Blaisorblade' Giarrusso Committed by Linus Torvalds
Browse files

[PATCH] uml: make UML_SETJMP always safe



If enable is moved by GCC in a register its value may not be preserved after
coming back there with longjmp().  So, mark it as volatile to prevent this;
this is suggested (it seems) in info gcc, when it talks about -Wuninitialized.
 I re-read this and it seems to say something different, but I still believe
this may be needed.

Signed-off-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d875f9fd
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -12,7 +12,8 @@ extern void longjmp(jmp_buf, int);
} while(0)
} while(0)


#define UML_SETJMP(buf) ({ \
#define UML_SETJMP(buf) ({ \
	int n, enable;	   \
	int n;	   \
	volatile int enable;	\
	enable = get_signals(); \
	enable = get_signals(); \
	n = setjmp(*buf); \
	n = setjmp(*buf); \
	if(n != 0) \
	if(n != 0) \