aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib/vsprintf.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-05-24 13:47:27 -0700
committerDavid S. Miller <davem@davemloft.net>2020-05-24 13:47:27 -0700
commit13209a8f7304a34158f4366e8ea07a1965c05ac7 (patch)
treef25ba4846fe02a32d4a14ef1a6be3227363da919 /lib/vsprintf.c
parentethtool: propagate get_coalesce return value (diff)
parentMerge tag 'efi-urgent-2020-05-24' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip (diff)
downloadwireguard-linux-13209a8f7304a34158f4366e8ea07a1965c05ac7.tar.xz
wireguard-linux-13209a8f7304a34158f4366e8ea07a1965c05ac7.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
The MSCC bug fix in 'net' had to be slightly adjusted because the register accesses are done slightly differently in net-next. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r--lib/vsprintf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 532b6606a18a..7c47ad52ce2f 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -794,6 +794,13 @@ static char *ptr_to_id(char *buf, char *end, const void *ptr,
unsigned long hashval;
int ret;
+ /*
+ * Print the real pointer value for NULL and error pointers,
+ * as they are not actual addresses.
+ */
+ if (IS_ERR_OR_NULL(ptr))
+ return pointer_string(buf, end, ptr, spec);
+
/* When debugging early boot use non-cryptographically secure hash. */
if (unlikely(debug_boot_weak_hash)) {
hashval = hash_long((unsigned long)ptr, 32);