summaryrefslogtreecommitdiffstats
path: root/lib/vsprintf.c
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.com>2019-09-16 12:54:25 +0200
committerPetr Mladek <pmladek@suse.com>2019-09-16 12:54:25 +0200
commitae88de56a1893bdccc7b5af8c12556de649d675e (patch)
treee3b70d7df5d379c20ac15d9fea3a7642e1f2f3e1 /lib/vsprintf.c
parentc9dccacfccc72c32692eedff4a27a4b0833a2afd (diff)
parent085a3a8fdf3e2fbd4678dbeccbb656bd328b3715 (diff)
downloadlinux-ae88de56a1893bdccc7b5af8c12556de649d675e.tar.bz2
Merge branch 'for-5.4' into for-linus
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r--lib/vsprintf.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index b0967cf17137..e78017a3e1bd 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -869,6 +869,15 @@ char *dentry_name(char *buf, char *end, const struct dentry *d, struct printf_sp
return widen_string(buf, n, end, spec);
}
+static noinline_for_stack
+char *file_dentry_name(char *buf, char *end, const struct file *f,
+ struct printf_spec spec, const char *fmt)
+{
+ if (check_pointer(&buf, end, f, spec))
+ return buf;
+
+ return dentry_name(buf, end, f->f_path.dentry, spec, fmt);
+}
#ifdef CONFIG_BLOCK
static noinline_for_stack
char *bdev_name(char *buf, char *end, struct block_device *bdev,
@@ -2166,9 +2175,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
case 'C':
return clock(buf, end, ptr, spec, fmt);
case 'D':
- return dentry_name(buf, end,
- ((const struct file *)ptr)->f_path.dentry,
- spec, fmt);
+ return file_dentry_name(buf, end, ptr, spec, fmt);
#ifdef CONFIG_BLOCK
case 'g':
return bdev_name(buf, end, ptr, spec, fmt);