4.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Quinn Tran <[email protected]>

commit 22e786ea47f8795c561e1a01b6a66bb2cae2fc20 upstream.

Stop GPNID command from advancing if command has failed.

Fixes: 726b85487067d ("qla2xxx: Add framework for async fabric discovery")
Cc: <[email protected]> # 4.10+
Signed-off-by: Quinn Tran <[email protected]>
Signed-off-by: Himanshu Madhani <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/scsi/qla2xxx/qla_gs.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -3211,6 +3211,11 @@ static void qla2x00_async_gpnid_sp_done(
            sp->name, res, ct_req->req.port_id.port_id,
            ct_rsp->rsp.gpn_id.port_name);
 
+       if (res) {
+               sp->free(sp);
+               return;
+       }
+
        memset(&ea, 0, sizeof(ea));
        memcpy(ea.port_name, ct_rsp->rsp.gpn_id.port_name, WWN_SIZE);
        ea.sp = sp;


Reply via email to