scsi: qedf: Check for fcoe_libfc_config failure
authorSaurav Kashyap <saurav.kashyap@cavium.com>
Mon, 22 Apr 2019 05:44:56 +0000 (22:44 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 29 Apr 2019 12:34:09 +0000 (08:34 -0400)
Print the fcoe_libfc_config failure and return proper failure.

Signed-off-by: Saurav Kashyap <saurav.kashyap@cavium.com>
Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qedf/qedf_main.c

index ffaf8f9b747f5369030bf91ec2de839f72e73466..a527b9b1f9af60797cad44281ed563350fe65f1a 100644 (file)
@@ -1618,7 +1618,11 @@ static int qedf_lport_setup(struct qedf_ctx *qedf)
        fc_set_wwnn(lport, qedf->wwnn);
        fc_set_wwpn(lport, qedf->wwpn);
 
-       fcoe_libfc_config(lport, &qedf->ctlr, &qedf_lport_template, 0);
+       if (fcoe_libfc_config(lport, &qedf->ctlr, &qedf_lport_template, 0)) {
+               QEDF_ERR(&qedf->dbg_ctx,
+                        "fcoe_libfc_config failed.\n");
+               return -ENOMEM;
+       }
 
        /* Allocate the exchange manager */
        fc_exch_mgr_alloc(lport, FC_CLASS_3, FCOE_PARAMS_NUM_TASKS,