Re: [PATCH] qla2x00t: Fix a memory leak in an error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/17/13 07:00, Saurav Kashyap wrote:
Instead of doing this I would move this check to the top of the function,
something like this
-----------------8<----------
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c
b/drivers/scsi/qla2xxx/qla_bsg.c
index 371bb86..b5f84ae 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.c
+++ b/drivers/scsi/qla2xxx/qla_bsg.c
@@ -255,6 +255,12 @@ qla2x00_process_els(struct fc_bsg_job *bsg_job)
         int rval =  (DRIVER_ERROR << 16);
         uint16_t nextlid = 0;


+       if (!vha->flags.online) {
+               ql_log(ql_log_warn, vha, 0x7005, "Host not online.\n");
+               rval = -EIO;
+               goto done;
+       }
+
         if (bsg_job->request->msgcode == FC_BSG_RPT_ELS) {
                 rport = bsg_job->rport;
                 fcport = *(fc_port_t **) rport->dd_data;
@@ -326,12 +332,6 @@ qla2x00_process_els(struct fc_bsg_job *bsg_job)
                         NPH_FABRIC_CONTROLLER : NPH_F_PORT;
         }


-       if (!vha->flags.online) {
-               ql_log(ql_log_warn, vha, 0x7005, "Host not online.\n");
-               rval = -EIO;
-               goto done;
-       }
-
         req_sg_cnt =
                 dma_map_sg(&ha->pdev->dev,
bsg_job->request_payload.sg_list,
                 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE);

----------------8<---------

Hello Saurav,

I will update the patch, retest and repost it. Thanks for the feedback.

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux