| .. | .. |
|---|
| 106 | 106 | static ssize_t kexec_crash_size_show(struct kobject *kobj, |
|---|
| 107 | 107 | struct kobj_attribute *attr, char *buf) |
|---|
| 108 | 108 | { |
|---|
| 109 | | - return sprintf(buf, "%zu\n", crash_get_memory_size()); |
|---|
| 109 | + ssize_t size = crash_get_memory_size(); |
|---|
| 110 | + |
|---|
| 111 | + if (size < 0) |
|---|
| 112 | + return size; |
|---|
| 113 | + |
|---|
| 114 | + return sprintf(buf, "%zd\n", size); |
|---|
| 110 | 115 | } |
|---|
| 111 | 116 | static ssize_t kexec_crash_size_store(struct kobject *kobj, |
|---|
| 112 | 117 | struct kobj_attribute *attr, |
|---|
| .. | .. |
|---|
| 137 | 142 | KERNEL_ATTR_RO(vmcoreinfo); |
|---|
| 138 | 143 | |
|---|
| 139 | 144 | #endif /* CONFIG_CRASH_CORE */ |
|---|
| 140 | | - |
|---|
| 141 | | -#if defined(CONFIG_PREEMPT_RT) |
|---|
| 142 | | -static ssize_t realtime_show(struct kobject *kobj, |
|---|
| 143 | | - struct kobj_attribute *attr, char *buf) |
|---|
| 144 | | -{ |
|---|
| 145 | | - return sprintf(buf, "%d\n", 1); |
|---|
| 146 | | -} |
|---|
| 147 | | -KERNEL_ATTR_RO(realtime); |
|---|
| 148 | | -#endif |
|---|
| 149 | 145 | |
|---|
| 150 | 146 | /* whether file capabilities are enabled */ |
|---|
| 151 | 147 | static ssize_t fscaps_show(struct kobject *kobj, |
|---|
| .. | .. |
|---|
| 237 | 233 | #ifndef CONFIG_TINY_RCU |
|---|
| 238 | 234 | &rcu_expedited_attr.attr, |
|---|
| 239 | 235 | &rcu_normal_attr.attr, |
|---|
| 240 | | -#endif |
|---|
| 241 | | -#ifdef CONFIG_PREEMPT_RT |
|---|
| 242 | | - &realtime_attr.attr, |
|---|
| 243 | 236 | #endif |
|---|
| 244 | 237 | NULL |
|---|
| 245 | 238 | }; |
|---|