]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
zram: avoid kunmap_atomic() of a NULL pointer
authorWeijie Yang <weijie.yang@samsung.com>
Thu, 13 Nov 2014 23:19:05 +0000 (15:19 -0800)
committerJiri Slaby <jslaby@suse.cz>
Wed, 19 Nov 2014 17:38:14 +0000 (18:38 +0100)
commit14ddbde7a77f3647238133ba3c4c84f64abcdd8d
tree68e79f637c026f4b4c6e5be01ba3f00174e58619
parent9546673d9dc0c6c642d7f4740622d15d7fb980f9
zram: avoid kunmap_atomic() of a NULL pointer

commit c406515239376fc93a30d5d03192182160cbd3fb upstream.

zram could kunmap_atomic() a NULL pointer in a rare situation: a zram
page becomes a full-zeroed page after a partial write io.  The current
code doesn't handle this case and performs kunmap_atomic() on a NULL
pointer, which panics the kernel.

This patch fixes this issue.

Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Weijie Yang <weijie.yang.kh@gmail.com>
Acked-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/staging/zram/zram_drv.c