diff options
| author | Krishna Gudipati <kgudipat@brocade.com> | 2012-07-13 19:08:22 -0400 |
|---|---|---|
| committer | James Bottomley <JBottomley@Parallels.com> | 2012-07-20 03:59:05 -0400 |
| commit | 529f9a765509c2c141ecfee0c54e17bf9a6b8bc1 (patch) | |
| tree | 01b273aebd0558e154e968fa925a2ee077730c1e | |
| parent | 85d22bbf6787c240921539bba224eb221bfb8ee1 (diff) | |
[SCSI] bfa: Fix to set correct return error codes and misc cleanup.
- Remove unnecessary if NULL check in function bfa_fcs_vport_free().
- Set correct return error codes in case of memory allocation failure
in the BSG ELS/CT passthru command handler.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| -rw-r--r-- | drivers/scsi/bfa/bfa_fcs_lport.c | 4 | ||||
| -rw-r--r-- | drivers/scsi/bfa/bfad_bsg.c | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c index 937000db62a8..bcc4966e8ba4 100644 --- a/drivers/scsi/bfa/bfa_fcs_lport.c +++ b/drivers/scsi/bfa/bfa_fcs_lport.c | |||
| @@ -5722,9 +5722,7 @@ bfa_fcs_vport_free(struct bfa_fcs_vport_s *vport) | |||
| 5722 | * The memory for the bfad_vport_s is freed from the FC function | 5722 | * The memory for the bfad_vport_s is freed from the FC function |
| 5723 | * template vport_delete entry point. | 5723 | * template vport_delete entry point. |
| 5724 | */ | 5724 | */ |
| 5725 | if (vport_drv) | 5725 | bfad_im_port_delete(vport_drv->drv_port.bfad, &vport_drv->drv_port); |
| 5726 | bfad_im_port_delete(vport_drv->drv_port.bfad, | ||
| 5727 | &vport_drv->drv_port); | ||
| 5728 | } | 5726 | } |
| 5729 | 5727 | ||
| 5730 | /* | 5728 | /* |
diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c index e1f4b10df42a..9c1495b321d9 100644 --- a/drivers/scsi/bfa/bfad_bsg.c +++ b/drivers/scsi/bfa/bfad_bsg.c | |||
| @@ -3008,12 +3008,15 @@ bfad_im_bsg_els_ct_request(struct fc_bsg_job *job) | |||
| 3008 | * buffer of size bsg_data->payload_len | 3008 | * buffer of size bsg_data->payload_len |
| 3009 | */ | 3009 | */ |
| 3010 | bsg_fcpt = kzalloc(bsg_data->payload_len, GFP_KERNEL); | 3010 | bsg_fcpt = kzalloc(bsg_data->payload_len, GFP_KERNEL); |
| 3011 | if (!bsg_fcpt) | 3011 | if (!bsg_fcpt) { |
| 3012 | rc = -ENOMEM; | ||
| 3012 | goto out; | 3013 | goto out; |
| 3014 | } | ||
| 3013 | 3015 | ||
| 3014 | if (copy_from_user((uint8_t *)bsg_fcpt, bsg_data->payload, | 3016 | if (copy_from_user((uint8_t *)bsg_fcpt, bsg_data->payload, |
| 3015 | bsg_data->payload_len)) { | 3017 | bsg_data->payload_len)) { |
| 3016 | kfree(bsg_fcpt); | 3018 | kfree(bsg_fcpt); |
| 3019 | rc = -EIO; | ||
| 3017 | goto out; | 3020 | goto out; |
| 3018 | } | 3021 | } |
| 3019 | 3022 | ||
