zram: fix invalid memory access
authorMinchan Kim <minchan@kernel.org>
Mon, 12 Aug 2013 06:13:55 +0000 (15:13 +0900)
committerAlex Shi <alex.shi@linaro.org>
Mon, 11 May 2015 09:36:12 +0000 (17:36 +0800)
commit5fc58bd448ae1b2bafd83fcb5e2c0d65fcee2c37
tree8e99b3e24b6aa99e222b9b095d8e1b8e421ed300
parentb237ffc2780c1c6d082930835e383143a51ea405
zram: fix invalid memory access

[1] tried to fix invalid memory access on zram->disk but it didn't
fix properly because get_disk failed during module exit path.

Actually, we don't need to reset zram->disk's capacity to zero
in module exit path so that this patch introduces new argument
"reset_capacity" on zram_reset_divice and it only reset it when
reset_store is called.

[1] 6030ea9b,  zram: avoid invalid memory access in zram_exit()

Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Jiang Liu <jiang.liu@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 2b86ab9cc29fcd435cde9378c3b9ffe8b5c76128)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
drivers/staging/zram/zram_drv.c