]> git.baikalelectronics.ru Git - kernel.git/commit
zram: fix invalid memory access
authorMinchan Kim <minchan@kernel.org>
Mon, 12 Aug 2013 06:13:55 +0000 (15:13 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Aug 2013 22:24:59 +0000 (15:24 -0700)
commit26ba5978b386e81131112702c439bcd226495971
tree1248f9e8577adf4ecb1a8fe3cc5bd1adaa4e5e35
parentb963bda71f853571e48b5e3d0fe77a64ccdd452d
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] 09b34d4f,  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>
drivers/staging/zram/zram_drv.c