zram: fix invalid memory access
authorMinchan Kim <minchan@kernel.org>
Mon, 12 Aug 2013 06:13:55 +0000 (15:13 +0900)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:47:15 +0000 (11:47 +0900)
commit33593077ae9b302b03f24a067a94b0d799d141b1
treea291cbec54257f6601269741344ad91159854de3
parentd10300c81c759ff1b226736f54ae4a630f3863d2
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()

Change-Id: Ibc554559bbd533bd986c6001ffb9cfb22f8c9f49
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>
drivers/staging/zram/zram_drv.c