]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] hpsa: fix a race in cmd_free/scsi_done
authorTomas Henzl <thenzl@redhat.com>
Thu, 1 Aug 2013 13:14:00 +0000 (15:14 +0200)
committerJames Bottomley <JBottomley@Parallels.com>
Mon, 26 Aug 2013 08:51:31 +0000 (12:51 +0400)
commitd621df3d4da9094b0779633fa8f4fcf7abfb8c11
treea506db6460685149054a2995770ba5b916bac2fa
parentef7ed4af4f06dd29a98d4bae4ba876aa56e4db84
[SCSI] hpsa: fix a race in cmd_free/scsi_done

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 <thenzl@redhat.com>
Acked-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/hpsa.c