KillZramBackingDevice: Return immediately if backing_dev is none.
It's possible that CONFIG_ZRAM_WRITEBACK is y, but userspace doesn't set the /sys/block/zram0/backing_dev, so its value is 'none'. It's the same with "CONFIG_ZRAM_WRITEBACK is not set". Change-Id: I2df89ceee68e4685deef5113bada21be96779e9b Signed-off-by: shisiyuan <shisiyuan@xiaomi.com>
This commit is contained in:
parent
a6c57d5752
commit
423c4f1994
1 changed files with 5 additions and 0 deletions
|
|
@ -478,6 +478,11 @@ static Result<void> KillZramBackingDevice() {
|
|||
// cut the last "\n"
|
||||
backing_dev.erase(backing_dev.length() - 1);
|
||||
|
||||
if (android::base::StartsWith(backing_dev, "none")) {
|
||||
LOG(INFO) << "No zram backing device configured";
|
||||
return {};
|
||||
}
|
||||
|
||||
// shutdown zram handle
|
||||
Timer swap_timer;
|
||||
LOG(INFO) << "swapoff() start...";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue