File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -582,6 +582,14 @@ static void fnic_scsi_init(struct fnic *fnic)
582
582
host -> transportt = fnic_fc_transport ;
583
583
}
584
584
585
+ static void fnic_free_ioreq_tables_mq (struct fnic * fnic )
586
+ {
587
+ int hwq ;
588
+
589
+ for (hwq = 0 ; hwq < fnic -> wq_copy_count ; hwq ++ )
590
+ kfree (fnic -> sw_copy_wq [hwq ].io_req_table );
591
+ }
592
+
585
593
static int fnic_scsi_drv_init (struct fnic * fnic )
586
594
{
587
595
struct Scsi_Host * host = fnic -> host ;
@@ -614,6 +622,11 @@ static int fnic_scsi_drv_init(struct fnic *fnic)
614
622
fnic -> sw_copy_wq [hwq ].io_req_table =
615
623
kzalloc ((fnic -> sw_copy_wq [hwq ].ioreq_table_size + 1 ) *
616
624
sizeof (struct fnic_io_req * ), GFP_KERNEL );
625
+
626
+ if (!fnic -> sw_copy_wq [hwq ].io_req_table ) {
627
+ fnic_free_ioreq_tables_mq (fnic );
628
+ return - ENOMEM ;
629
+ }
617
630
}
618
631
619
632
dev_info (& fnic -> pdev -> dev , "fnic copy wqs: %d, Q0 ioreq table size: %d\n" ,
@@ -1060,6 +1073,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1060
1073
1061
1074
err_out_free_stats_debugfs :
1062
1075
fnic_stats_debugfs_remove (fnic );
1076
+ fnic_free_ioreq_tables_mq (fnic );
1063
1077
scsi_remove_host (fnic -> host );
1064
1078
err_out_scsi_drv_init :
1065
1079
fnic_free_intr (fnic );
You can’t perform that action at this time.
0 commit comments