aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 1a058ec9bd0c..083997c3066e 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1786,12 +1786,11 @@ qla2x00_alloc_fcport(scsi_qla_host_t *ha, gfp_t flags)
1786{ 1786{
1787 fc_port_t *fcport; 1787 fc_port_t *fcport;
1788 1788
1789 fcport = kmalloc(sizeof(fc_port_t), flags); 1789 fcport = kzalloc(sizeof(fc_port_t), flags);
1790 if (fcport == NULL) 1790 if (!fcport)
1791 return (fcport); 1791 return NULL;
1792 1792
1793 /* Setup fcport template structure. */ 1793 /* Setup fcport template structure. */
1794 memset(fcport, 0, sizeof (fc_port_t));
1795 fcport->ha = ha; 1794 fcport->ha = ha;
1796 fcport->vp_idx = ha->vp_idx; 1795 fcport->vp_idx = ha->vp_idx;
1797 fcport->port_type = FCT_UNKNOWN; 1796 fcport->port_type = FCT_UNKNOWN;
@@ -1801,7 +1800,7 @@ qla2x00_alloc_fcport(scsi_qla_host_t *ha, gfp_t flags)
1801 fcport->supported_classes = FC_COS_UNSPECIFIED; 1800 fcport->supported_classes = FC_COS_UNSPECIFIED;
1802 spin_lock_init(&fcport->rport_lock); 1801 spin_lock_init(&fcport->rport_lock);
1803 1802
1804 return (fcport); 1803 return fcport;
1805} 1804}
1806 1805
1807/* 1806/*
@@ -2473,13 +2472,12 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
2473 rval = QLA_SUCCESS; 2472 rval = QLA_SUCCESS;
2474 2473
2475 /* Try GID_PT to get device list, else GAN. */ 2474 /* Try GID_PT to get device list, else GAN. */
2476 swl = kmalloc(sizeof(sw_info_t) * MAX_FIBRE_DEVICES, GFP_ATOMIC); 2475 swl = kcalloc(MAX_FIBRE_DEVICES, sizeof(sw_info_t), GFP_ATOMIC);
2477 if (swl == NULL) { 2476 if (!swl) {
2478 /*EMPTY*/ 2477 /*EMPTY*/
2479 DEBUG2(printk("scsi(%ld): GID_PT allocations failed, fallback " 2478 DEBUG2(printk("scsi(%ld): GID_PT allocations failed, fallback "
2480 "on GA_NXT\n", ha->host_no)); 2479 "on GA_NXT\n", ha->host_no));
2481 } else { 2480 } else {
2482 memset(swl, 0, sizeof(sw_info_t) * MAX_FIBRE_DEVICES);
2483 if (qla2x00_gid_pt(ha, swl) != QLA_SUCCESS) { 2481 if (qla2x00_gid_pt(ha, swl) != QLA_SUCCESS) {
2484 kfree(swl); 2482 kfree(swl);
2485 swl = NULL; 2483 swl = NULL;