mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 10:00:51 +07:00
lib/vsprintf.c: fix interaction of kasprintf() and vsnprintf() when using %pV
Otherwise, the warning at the top of vsnprintf() gets triggered by kvasprintf()'s first invocation (with NULL buffer and zero size) of vsnprintf(). Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
746a2a838d
commit
d9be9b90d6
@ -898,7 +898,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
|
||||
case 'U':
|
||||
return uuid_string(buf, end, ptr, spec, fmt);
|
||||
case 'V':
|
||||
return buf + vsnprintf(buf, end - buf,
|
||||
return buf + vsnprintf(buf, end > buf ? end - buf : 0,
|
||||
((struct va_format *)ptr)->fmt,
|
||||
*(((struct va_format *)ptr)->va));
|
||||
case 'K':
|
||||
|
Loading…
Reference in New Issue
Block a user