From: Geert Uytterhoeven Date: Wed, 5 Nov 2008 22:21:16 +0000 (+0100) Subject: [JFFS2] fix race condition in jffs2_lzo_compress() X-Git-Tag: v2.6.28-rc4~33^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc8a0843a435b2c0891e7eaea64faaf1ebec9b11;p=pandora-kernel.git [JFFS2] fix race condition in jffs2_lzo_compress() deflate_mutex protects the globals lzo_mem and lzo_compress_buf. However, jffs2_lzo_compress() unlocks deflate_mutex _before_ it has copied out the compressed data from lzo_compress_buf. Correct this by moving the mutex unlock after the copy. In addition, document what deflate_mutex actually protects. Cc: stable@kernel.org Signed-off-by: Geert Uytterhoeven Acked-by: Richard Purdie Signed-off-by: Andrew Morton Signed-off-by: David Woodhouse --- Reading git-diff-tree failed