hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/scsi/hpsa.c
....@@ -5834,7 +5834,7 @@
58345834 {
58355835 struct Scsi_Host *sh;
58365836
5837
- sh = scsi_host_alloc(&hpsa_driver_template, sizeof(h));
5837
+ sh = scsi_host_alloc(&hpsa_driver_template, sizeof(struct ctlr_info));
58385838 if (sh == NULL) {
58395839 dev_err(&h->pdev->dev, "scsi_host_alloc failed\n");
58405840 return -ENOMEM;
....@@ -8904,7 +8904,7 @@
89048904 destroy_workqueue(h->monitor_ctlr_wq);
89058905 h->monitor_ctlr_wq = NULL;
89068906 }
8907
- kfree(h);
8907
+ hpda_free_ctlr_info(h);
89088908 return rc;
89098909 }
89108910
....@@ -9764,7 +9764,8 @@
97649764 return 0;
97659765
97669766 free_sas_phy:
9767
- hpsa_free_sas_phy(hpsa_sas_phy);
9767
+ sas_phy_free(hpsa_sas_phy->phy);
9768
+ kfree(hpsa_sas_phy);
97689769 free_sas_port:
97699770 hpsa_free_sas_port(hpsa_sas_port);
97709771 free_sas_node:
....@@ -9800,10 +9801,12 @@
98009801
98019802 rc = hpsa_sas_port_add_rphy(hpsa_sas_port, rphy);
98029803 if (rc)
9803
- goto free_sas_port;
9804
+ goto free_sas_rphy;
98049805
98059806 return 0;
98069807
9808
+free_sas_rphy:
9809
+ sas_rphy_free(rphy);
98079810 free_sas_port:
98089811 hpsa_free_sas_port(hpsa_sas_port);
98099812 device->sas_port = NULL;