diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-12-13 20:16:40 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-12-13 20:16:40 -0300 |
commit | 6baeafd1f2a54ca041ff71778ebda9fac75aad12 (patch) | |
tree | 57d2d68fa5d1d91f57cd7fcf0aed0a97892cc8cc /drivers/block | |
parent | 189382f7a338c02b448ab27e1d5566e052165dc8 (diff) |
Linux-libre 4.8.14-gnuHEADpck-4.8.14-gnumaster
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/zram/zram_drv.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 04365b17e..5163c8f91 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1403,7 +1403,8 @@ static ssize_t hot_remove_store(struct class *class, zram = idr_find(&zram_index_idr, dev_id); if (zram) { ret = zram_remove(zram); - idr_remove(&zram_index_idr, dev_id); + if (!ret) + idr_remove(&zram_index_idr, dev_id); } else { ret = -ENODEV; } |