From: Tomas Henzl Date: Thu, 1 Aug 2013 13:14:00 +0000 (+0200) Subject: hpsa: fix a race in cmd_free/scsi_done X-Git-Tag: v3.2.65~5 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e87cf8149d14c01a665e65029ad76530b228e901;p=pandora-kernel.git hpsa: fix a race in cmd_free/scsi_done commit 2cc5bfaf854463d9d1aa52091f60110fbf102a96 upstream. When the driver calls scsi_done and after that frees it's internal preallocated memory it can happen that a new job is enqueud before the memory is freed. The allocation fails and the message "cmd_alloc returned NULL" is shown. Patch below fixes it by moving cmd->scsi_done after cmd_free. Signed-off-by: Tomas Henzl Acked-by: Stephen M. Cameron Signed-off-by: James Bottomley Signed-off-by: Ben Hutchings Cc: Masoud Sharbiani --- Reading git-diff-tree failed