summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfad_bsg.c
diff options
context:
space:
mode:
authorKrishna Gudipati <kgudipat@brocade.com>2012-07-13 16:08:22 -0700
committerJames Bottomley <JBottomley@Parallels.com>2012-07-20 08:59:05 +0100
commit529f9a765509c2c141ecfee0c54e17bf9a6b8bc1 (patch)
tree01b273aebd0558e154e968fa925a2ee077730c1e /drivers/scsi/bfa/bfad_bsg.c
parent85d22bbf6787c240921539bba224eb221bfb8ee1 (diff)
downloadlinux-529f9a765509c2c141ecfee0c54e17bf9a6b8bc1.tar.bz2
[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>
Diffstat (limited to 'drivers/scsi/bfa/bfad_bsg.c')
-rw-r--r--drivers/scsi/bfa/bfad_bsg.c5
1 files changed, 4 insertions, 1 deletions
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)
* buffer of size bsg_data->payload_len
*/
bsg_fcpt = kzalloc(bsg_data->payload_len, GFP_KERNEL);
- if (!bsg_fcpt)
+ if (!bsg_fcpt) {
+ rc = -ENOMEM;
goto out;
+ }
if (copy_from_user((uint8_t *)bsg_fcpt, bsg_data->payload,
bsg_data->payload_len)) {
kfree(bsg_fcpt);
+ rc = -EIO;
goto out;
}