diff options
| author | Linus Walleij <[email protected]> | 2015-12-21 08:36:21 +0000 |
|---|---|---|
| committer | Linus Walleij <[email protected]> | 2015-12-21 08:36:21 +0000 |
| commit | 0529357f102b96f68bc199f858d1c3b07f4b674c (patch) | |
| tree | eaa047952a768099e00a5245afa0d84799df6990 /drivers/base/memory.c | |
| parent | gpio: pch: fix non-DT build (diff) | |
| parent | Linux 4.4-rc6 (diff) | |
| download | kernel-0529357f102b96f68bc199f858d1c3b07f4b674c.tar.gz kernel-0529357f102b96f68bc199f858d1c3b07f4b674c.zip | |
Merge tag 'v4.4-rc6' into devel
Linux 4.4-rc6
Diffstat (limited to 'drivers/base/memory.c')
| -rw-r--r-- | drivers/base/memory.c | 4 |
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); } |
