Messages in this thread Patch in this message | | | From | Richard Weinberger <> | Subject | [PATCH 1/2] Fix printk() on ERR_PTR() | Date | Sun, 10 May 2015 21:42:15 +0200 |
| |
vbin_printf() checks whether the provided pointer is larger than -PAGE_SIZE such that it does not explode on ERR_PTR() pointers. printk() does not.
Let's add this check also to the printk() code such that trace_printk() and printk() are consistent again.
Signed-off-by: Richard Weinberger <richard@nod.at> --- lib/vsprintf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index da39c60..092d5a7 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -511,7 +511,8 @@ char *string(char *buf, char *end, const char *s, struct printf_spec spec) { int len, i; - if ((unsigned long)s < PAGE_SIZE) + if ((unsigned long)s > (unsigned long)-PAGE_SIZE || + (unsigned long)s < PAGE_SIZE) s = "(null)"; len = strnlen(s, spec.precision); -- 1.8.4.5
| |