aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-11-30 16:33:41 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-11-30 16:33:41 -0800
commit43c4f67c966deb1478dc9acbf66ab547287d530f (patch)
treee56086810b8781df2b8b20f547c4edc5c8539e3d /drivers
parentMerge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux (diff)
parentmm: fix false-positive WARN_ON() in truncate/invalidate for hugetlb (diff)
downloadwireguard-linux-43c4f67c966deb1478dc9acbf66ab547287d530f.tar.xz
wireguard-linux-43c4f67c966deb1478dc9acbf66ab547287d530f.zip
Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton: "7 fixes" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: mm: fix false-positive WARN_ON() in truncate/invalidate for hugetlb kasan: support use-after-scope detection kasan: update kasan_global for gcc 7 lib/debugobjects: export for use in modules zram: fix unbalanced idr management at hot removal thp: fix corner case of munlock() of PTE-mapped THPs mm, thp: propagation of conditional compilation in khugepaged.c
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/zram/zram_drv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 04365b17ee67..5163c8f918cb 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;
}