summaryrefslogtreecommitdiff
path: root/drivers/scsi/bfa/bfad_im.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-04-13 14:14:41 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2016-05-09 22:18:42 -0400
commit4e51af9ee7afa0ecf4829e7a44f7055db7968e02 (patch)
tree4854217bf3a1b824d399753b984b50eddc04e372 /drivers/scsi/bfa/bfad_im.c
parent13f307711b127d30fcf333a04365a217baf9ca2b (diff)
downloadlinux-next-4e51af9ee7afa0ecf4829e7a44f7055db7968e02.tar.gz
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/bfad_im.c')
-rw-r--r--drivers/scsi/bfa/bfad_im.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c
index 6c805e13f8dd..02d806012fa1 100644
--- a/drivers/scsi/bfa/bfad_im.c
+++ b/drivers/scsi/bfa/bfad_im.c
@@ -440,13 +440,13 @@ bfad_im_slave_destroy(struct scsi_device *sdev)
* BFA FCS itnim alloc callback, after successful PRLI
* Context: Interrupt
*/
-void
+int
bfa_fcb_itnim_alloc(struct bfad_s *bfad, struct bfa_fcs_itnim_s **itnim,
struct bfad_itnim_s **itnim_drv)
{
*itnim_drv = kzalloc(sizeof(struct bfad_itnim_s), GFP_ATOMIC);
if (*itnim_drv == NULL)
- return;
+ return -ENOMEM;
(*itnim_drv)->im = bfad->im;
*itnim = &(*itnim_drv)->fcs_itnim;
@@ -457,6 +457,7 @@ bfa_fcb_itnim_alloc(struct bfad_s *bfad, struct bfa_fcs_itnim_s **itnim,
*/
INIT_WORK(&(*itnim_drv)->itnim_work, bfad_im_itnim_work_handler);
bfad->bfad_flags |= BFAD_RPORT_ONLINE;
+ return 0;
}
/*