scsi: hisi_sas: fix NULL deference when TMF timeouts
authorJohn Garry <john.garry@huawei.com>
Mon, 10 Apr 2017 13:22:00 +0000 (21:22 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 12 Apr 2017 02:01:04 +0000 (22:01 -0400)
commitd3c4dd4e3dc52a7a8ae4cfd91fedffdeeb6e003b
tree29280b85bd5bc883a212d9936289612dd059f12b
parent0844a3ff00e30cf7e8edbce40eab83593c051c78
scsi: hisi_sas: fix NULL deference when TMF timeouts

If a TMF timeouts (maybe due to unlikely scenario of an expander being
unplugged when TMF for remote device is active), when we eventually try
to free the slot, we crash as we dereference the slot's task, which has
already been released.

As a fix, add checks in the slot release code for a NULL task.

Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hisi_sas/hisi_sas_main.c