]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
SCSI: qla2xxx: Free rsp_data even on error in qla2x00_process_loopback()
authorSteve Hodgson <steve@purestorage.com>
Wed, 21 Nov 2012 07:39:56 +0000 (02:39 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jan 2013 16:45:57 +0000 (08:45 -0800)
commit 9bceab4e08c5e329e9def7fe1cab41c467236517 upstream.

Signed-off-by: Steve Hodgson <steve@purestorage.com>
Signed-off-by: Armen Baloyan <armen.baloyan@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/qla2xxx/qla_bsg.c

index 05520be511b6a7a94508c6e4e61ee12213bd738e..9f34dedcdad75c77aac2b3bc232d1a354953eb9b 100644 (file)
@@ -743,7 +743,7 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
                                ql_log(ql_log_warn, vha, 0x701f,
                                    "Get port config failed.\n");
                                rval = -EPERM;
-                               goto done_free_dma_req;
+                               goto done_free_dma_rsp;
                        }
 
                        ql_dbg(ql_dbg_user, vha, 0x70c0,
@@ -762,7 +762,7 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
 
                        if (rval) {
                                rval = -EPERM;
-                               goto done_free_dma_req;
+                               goto done_free_dma_rsp;
                        }
 
                        type = "FC_BSG_HST_VENDOR_LOOPBACK";
@@ -795,7 +795,7 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
                                }
 
                                rval = -EIO;
-                               goto done_free_dma_req;
+                               goto done_free_dma_rsp;
                        }
                } else {
                        type = "FC_BSG_HST_VENDOR_LOOPBACK";
@@ -830,6 +830,7 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
        fw_sts_ptr += sizeof(response);
        *fw_sts_ptr = command_sent;
 
+done_free_dma_rsp:
        dma_free_coherent(&ha->pdev->dev, rsp_data_len,
                rsp_data, rsp_data_dma);
 done_free_dma_req: