summaryrefslogtreecommitdiffstats
path: root/drivers/base/memory.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-12-13 19:20:27 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-12-13 19:20:27 -0800
commit252ca494ac75f0dc47469f130d6dc67ed14081f4 (patch)
tree159e9931af199f8acf50f9982f281ee69ceb7cbf /drivers/base/memory.c
parent900937c0375efcbb2c9fb2eef50ccb5c98fc99ea (diff)
parent9f9499ae8e6415cefc4fe0a96ad0e27864353c89 (diff)
downloadlinux-252ca494ac75f0dc47469f130d6dc67ed14081f4.tar.bz2
Merge 4.4-rc5 into usb-next as we want those fixes here for testing
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/memory.c')
-rw-r--r--drivers/base/memory.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 2804aed3f416..25425d3f2575 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -303,6 +303,10 @@ static int memory_subsys_offline(struct device *dev)
if (mem->state == MEM_OFFLINE)
return 0;
+ /* Can't offline block with non-present sections */
+ if (mem->section_count != sections_per_block)
+ return -EINVAL;
+
return memory_block_change_state(mem, MEM_OFFLINE, MEM_ONLINE);
}