diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-04-13 14:14:41 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-05-09 22:18:42 -0400 |
commit | 4e51af9ee7afa0ecf4829e7a44f7055db7968e02 (patch) | |
tree | 4854217bf3a1b824d399753b984b50eddc04e372 /drivers/scsi/bfa/bfa_fcs_fcpim.c | |
parent | 13f307711b127d30fcf333a04365a217baf9ca2b (diff) | |
download | linux-4e51af9ee7afa0ecf4829e7a44f7055db7968e02.tar.bz2 |
bfa: fix bfa_fcb_itnim_alloc() error handling
The caller assumes that "itnim" is NULL on error and non-NULL on success
but really "itnim" is uninitialized on error. This function should just
use normal error handling where it returns zero on success and negative
on failure.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/bfa/bfa_fcs_fcpim.c')
-rw-r--r-- | drivers/scsi/bfa/bfa_fcs_fcpim.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/bfa/bfa_fcs_fcpim.c b/drivers/scsi/bfa/bfa_fcs_fcpim.c index 4f089d76afb1..2e3b19e7e079 100644 --- a/drivers/scsi/bfa/bfa_fcs_fcpim.c +++ b/drivers/scsi/bfa/bfa_fcs_fcpim.c @@ -588,12 +588,13 @@ bfa_fcs_itnim_create(struct bfa_fcs_rport_s *rport) struct bfa_fcs_lport_s *port = rport->port; struct bfa_fcs_itnim_s *itnim; struct bfad_itnim_s *itnim_drv; + int ret; /* * call bfad to allocate the itnim */ - bfa_fcb_itnim_alloc(port->fcs->bfad, &itnim, &itnim_drv); - if (itnim == NULL) { + ret = bfa_fcb_itnim_alloc(port->fcs->bfad, &itnim, &itnim_drv); + if (ret) { bfa_trc(port->fcs, rport->pwwn); return NULL; } |