mirror of
https://github.com/torvalds/linux.git
synced 2024-09-27 10:23:00 +00:00
[PATCH] Fix missing parens in set_personality()
If you call set_personality() with an expression such as: set_personality(foo ? PERS_FOO1 : PERS_FOO2); then this evaluates to: ((current->personality == foo ? PERS_FOO1 : PERS_FOO2) ? ... which is obviously not the intended result. Add the missing parents to ensure this gets evaluated as expected: ((current->personality == (foo ? PERS_FOO1 : PERS_FOO2)) ? ... Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
e40c67597e
commit
d8b295f290
|
@ -114,7 +114,7 @@ struct exec_domain {
|
||||||
* Change personality of the currently running process.
|
* Change personality of the currently running process.
|
||||||
*/
|
*/
|
||||||
#define set_personality(pers) \
|
#define set_personality(pers) \
|
||||||
((current->personality == pers) ? 0 : __set_personality(pers))
|
((current->personality == (pers)) ? 0 : __set_personality(pers))
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
#endif /* __KERNEL__ */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user