|
@@ -128,6 +128,9 @@ static ssize_t show_mem_removable(struct device *dev,
|
|
|
int ret = 1;
|
|
|
struct memory_block *mem = to_memory_block(dev);
|
|
|
|
|
|
+ if (mem->state != MEM_ONLINE)
|
|
|
+ goto out;
|
|
|
+
|
|
|
for (i = 0; i < sections_per_block; i++) {
|
|
|
if (!present_section_nr(mem->start_section_nr + i))
|
|
|
continue;
|
|
@@ -135,6 +138,7 @@ static ssize_t show_mem_removable(struct device *dev,
|
|
|
ret &= is_mem_section_removable(pfn, PAGES_PER_SECTION);
|
|
|
}
|
|
|
|
|
|
+out:
|
|
|
return sprintf(buf, "%d\n", ret);
|
|
|
}
|
|
|
|