diff options
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 249b1eb1e6e1..a4a94e700fb9 100644 --- a/kernel/resource.c +++ b/kernel/resource.c | |||
@@ -105,16 +105,25 @@ static int r_show(struct seq_file *m, void *v) | |||
105 | { | 105 | { |
106 | struct resource *root = m->private; | 106 | struct resource *root = m->private; |
107 | struct resource *r = v, *p; | 107 | struct resource *r = v, *p; |
108 | unsigned long long start, end; | ||
108 | int width = root->end < 0x10000 ? 4 : 8; | 109 | int width = root->end < 0x10000 ? 4 : 8; |
109 | int depth; | 110 | int depth; |
110 | 111 | ||
111 | for (depth = 0, p = r; depth < MAX_IORES_LEVEL; depth++, p = p->parent) | 112 | for (depth = 0, p = r; depth < MAX_IORES_LEVEL; depth++, p = p->parent) |
112 | if (p->parent == root) | 113 | if (p->parent == root) |
113 | break; | 114 | break; |
115 | |||
116 | if (file_ns_capable(m->file, &init_user_ns, CAP_SYS_ADMIN)) { | ||
117 | start = r->start; | ||
118 | end = r->end; | ||
119 | } else { | ||
120 | start = end = 0; | ||
121 | } | ||
122 | |||
114 | seq_printf(m, "%*s%0*llx-%0*llx : %s\n", | 123 | seq_printf(m, "%*s%0*llx-%0*llx : %s\n", |
115 | depth * 2, "", | 124 | depth * 2, "", |
116 | width, (unsigned long long) r->start, | 125 | width, start, |
117 | width, (unsigned long long) r->end, | 126 | width, end, |
118 | r->name ? r->name : "<BAD>"); | 127 | r->name ? r->name : "<BAD>"); |
119 | return 0; | 128 | return 0; |
120 | } | 129 | } |