From: Ming Lei Date: Sat, 4 Aug 2012 04:01:17 +0000 (+0800) Subject: firmware loader: fix races during loading firmware X-Git-Tag: omap-for-v3.7-rc1/fixes-cpufreq-signed~76^2~86 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28eefa750b5e16b13bb869c2c4f7d624a43eb48b;p=pandora-kernel.git firmware loader: fix races during loading firmware This patch fixes two races in loading firmware: 1, FW_STATUS_DONE should be set before waking up the task waitting on _request_firmware_load, otherwise FW_STATUS_ABORT may be thought as DONE mistakenly. 2, Inside _request_firmware_load(), there is a small window between wait_for_completion() and mutex_lock(&fw_lock), and 'echo 1 > loading' still may happen during the period, so this patch checks FW_STATUS_DONE to prevent pages' buffer completed from being freed in firmware_loading_store. Signed-off-by: Ming Lei Cc: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed