]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: qla2xxx: Fix oops in qla2x00_probe_one error path
authorDouglas Miller <dougmill@linux.vnet.ibm.com>
Fri, 20 Oct 2017 13:17:22 +0000 (08:17 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 31 Oct 2017 12:06:07 +0000 (08:06 -0400)
commitba9ae1931ff6716a3972ed3a83f29e5487e54922
tree45d046e60b13c6690c62be29b032d7bdd25683a8
parent34beea030c29c476b3397eb344edb7af23d0bc3e
scsi: qla2xxx: Fix oops in qla2x00_probe_one error path

On error, kthread_create() returns an errno-encoded pointer, not NULL.
The routine qla2x00_probe_one() detects the error case and jumps to
probe_failed, but has already assigned the return value from
kthread_create() to ha->dpc_thread.  Then probe_failed checks to see if
ha->dpc_thread is not NULL before doing cleanup on it. Since in the
error case this is also not NULL, it ends up trying to access an invalid
task pointer.

Solution is to assign NULL to ha->dpc_thread in the error path to avoid
kthread cleanup in that case.

Signed-off-by: Douglas Miller <dougmill@linux.vnet.ibm.com>
Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_os.c