diff options
author | Ingo Molnar <mingo@kernel.org> | 2016-05-04 08:48:26 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-05-04 08:48:26 +0200 |
commit | d63c214b0a39e7e92fbae2a47b66e8145c3c9c81 (patch) | |
tree | ca797379eeb01c96308c8e2abdcea3b55040d489 /kernel/resource.c | |
parent | 47a541c3e19374ec9f5d3d96730a922e8480dda5 (diff) | |
parent | 04974df8049fc4240d22759a91e035082ccd18b4 (diff) | |
download | linux-d63c214b0a39e7e92fbae2a47b66e8145c3c9c81.tar.bz2 |
Merge tag 'v4.6-rc6' into x86/platform, to refresh the tree
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/resource.c')
-rw-r--r-- | kernel/resource.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/kernel/resource.c b/kernel/resource.c index 2e78ead30934..9b5f04404152 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -105,16 +105,25 @@ static int r_show(struct seq_file *m, void *v) { struct resource *root = m->private; struct resource *r = v, *p; + unsigned long long start, end; int width = root->end < 0x10000 ? 4 : 8; int depth; for (depth = 0, p = r; depth < MAX_IORES_LEVEL; depth++, p = p->parent) if (p->parent == root) break; + + if (file_ns_capable(m->file, &init_user_ns, CAP_SYS_ADMIN)) { + start = r->start; + end = r->end; + } else { + start = end = 0; + } + seq_printf(m, "%*s%0*llx-%0*llx : %s\n", depth * 2, "", - width, (unsigned long long) r->start, - width, (unsigned long long) r->end, + width, start, + width, end, r->name ? r->name : "<BAD>"); return 0; } |