From: Seth Jennings Date: Thu, 6 Oct 2011 19:28:26 +0000 (-0500) Subject: staging: zcache: fix crash on cpu remove X-Git-Tag: v3.2-rc1~169^2^2~125 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8550be08cbed164a8357491cc2c27cb99282b7ff;p=pandora-kernel.git staging: zcache: fix crash on cpu remove In the case that a cpu is taken offline before zcache_do_preload() is ever called on the cpu, the per-cpu zcache_preloads structure will be uninitialized. In the CPU_DEAD case for zcache_cpu_notifier(), kp->obj is not checked before calling kmem_cache_free() on it. If it is NULL, a crash results. This patch ensures that both kp->obj and kp->page are not NULL before calling the respective free functions. In practice, just checking one or the other should be sufficient since they are assigned together in zcache_do_preload(), but I check both for safety. Signed-off-by: Seth Jennings Acked-by: Dave Hansen Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed