From: Jens Axboe Date: Fri, 12 Dec 2014 15:53:40 +0000 (-0700) Subject: NVMe: fix race condition in nvme_submit_sync_cmd() X-Git-Tag: omap-for-v3.20/drop-legacy-3517~91^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=849c6e7746e4f6317ace6aa7d2fcdcd844e99ddb;p=pandora-kernel.git NVMe: fix race condition in nvme_submit_sync_cmd() If we have a race between the schedule timing out and the command completing, we could have the task issuing the command exit nvme_submit_sync_cmd() while the irq is running sync_completion(). If that happens, we could be corrupting memory, since the stack that held 'cmdinfo' is no longer valid. Fix this by always calling nvme_abort_cmd_info(). Once that call completes, we know that we have either run sync_completion() if the completion came in, or that we will never run it since we now have special_completion() as the command callback handler. Acked-by: Keith Busch Signed-off-by: Jens Axboe --- Reading git-diff-tree failed