projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
91c49c2
)
x86/pkeys/selftests: Fix protection keys write() warning
author
Dave Hansen
<
[email protected]
>
Sat, 11 Nov 2017 00:12:32 +0000
(16:12 -0800)
committer
Ingo Molnar
<
[email protected]
>
Tue, 21 Nov 2017 08:34:52 +0000
(09:34 +0100)
write() is marked as having a must-check return value. Check it and
abort if we fail to write an error message from a signal handler.
Signed-off-by: Dave Hansen <
[email protected]
>
Acked-by: Thomas Gleixner <
[email protected]
>
Cc: Andy Lutomirski <
[email protected]
>
Cc: Borislav Petkov <
[email protected]
>
Cc: Brian Gerst <
[email protected]
>
Cc: Denys Vlasenko <
[email protected]
>
Cc: H. Peter Anvin <
[email protected]
>
Cc: Josh Poimboeuf <
[email protected]
>
Cc: Linus Torvalds <
[email protected]
>
Cc: Peter Zijlstra <
[email protected]
>
Link:
http://lkml.kernel.org/r/
[email protected]
Signed-off-by: Ingo Molnar <
[email protected]
>
tools/testing/selftests/x86/pkey-helpers.h
patch
|
blob
|
history
diff --git
a/tools/testing/selftests/x86/pkey-helpers.h
b/tools/testing/selftests/x86/pkey-helpers.h
index 3818f25391c24c34beeb20c2e9f937bdfc9b111a..b3cb7670e02661cd2ab66fd3da98b3940dd44c70 100644
(file)
--- a/
tools/testing/selftests/x86/pkey-helpers.h
+++ b/
tools/testing/selftests/x86/pkey-helpers.h
@@
-30,6
+30,7
@@
static inline void sigsafe_printf(const char *format, ...)
if (!dprint_in_signal) {
vprintf(format, ap);
} else {
+ int ret;
int len = vsnprintf(dprint_in_signal_buffer,
DPRINT_IN_SIGNAL_BUF_SIZE,
format, ap);
@@
-39,7
+40,9
@@
static inline void sigsafe_printf(const char *format, ...)
*/
if (len > DPRINT_IN_SIGNAL_BUF_SIZE)
len = DPRINT_IN_SIGNAL_BUF_SIZE;
- write(1, dprint_in_signal_buffer, len);
+ ret = write(1, dprint_in_signal_buffer, len);
+ if (ret < 0)
+ abort();
}
va_end(ap);
}