提交 d8b295f2 编写于 作者: R Russell King 提交者: Linus Torvalds

[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: NRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 e40c6759
......@@ -114,7 +114,7 @@ struct exec_domain {
* Change personality of the currently running process.
*/
#define set_personality(pers) \
((current->personality == pers) ? 0 : __set_personality(pers))
((current->personality == (pers)) ? 0 : __set_personality(pers))
#endif /* __KERNEL__ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册