From: Weijie Yang Date: Wed, 29 Oct 2014 21:50:57 +0000 (-0700) Subject: zram: avoid NULL pointer access in concurrent situation X-Git-Tag: omap-for-v3.19/fixes-not-urgent-part1~39^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a99e95b8d1cd47f6feddcdca6c71d22060df8a2;p=pandora-kernel.git zram: avoid NULL pointer access in concurrent situation There is a rare NULL pointer bug in mem_used_total_show() and mem_used_max_store() in concurrent situation, like this: zram is not initialized, process A is a mem_used_total reader which runs periodically, while process B try to init zram. process A process B access meta, get a NULL value init zram, done init_done() is true access meta->mem_pool, get a NULL pointer BUG This patch fixes this issue. Signed-off-by: Weijie Yang Acked-by: Minchan Kim Acked-by: Sergey Senozhatsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed