summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hisi_sas/hisi_sas_main.c
diff options
context:
space:
mode:
authorJohn Garry <john.garry@huawei.com>2017-08-11 00:09:43 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2017-08-24 22:28:49 -0400
commit76aae5f60bb0029cd1a5b9fa8ed6705498db52ee (patch)
treeddc0cbda23166cf5b728ac4a00576e167a3092e2 /drivers/scsi/hisi_sas/hisi_sas_main.c
parent5aec704f0db7b12663b13b3c73dc1432f9dddcf0 (diff)
downloadop-kernel-dev-76aae5f60bb0029cd1a5b9fa8ed6705498db52ee.zip
op-kernel-dev-76aae5f60bb0029cd1a5b9fa8ed6705498db52ee.tar.gz
scsi: hisi_sas: replace kfree with scsi_host_put
Instances of kfree(shost) should be replaced with scsi_host_put(). In addition, a missing scsi_host_put() is added for error path in hisi_sas_shost_alloc_pci() and v3 driver removal. Signed-off-by: Pan Bian <bianpan2016@163.com> # For main.c changes Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/hisi_sas/hisi_sas_main.c')
-rw-r--r--drivers/scsi/hisi_sas/hisi_sas_main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 4112afd..9427835 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -1900,7 +1900,7 @@ static struct Scsi_Host *hisi_sas_shost_alloc(struct platform_device *pdev,
return shost;
err_out:
- kfree(shost);
+ scsi_host_put(shost);
dev_err(dev, "shost alloc failed\n");
return NULL;
}
@@ -1991,7 +1991,7 @@ err_out_register_ha:
scsi_remove_host(shost);
err_out_ha:
hisi_sas_free(hisi_hba);
- kfree(shost);
+ scsi_host_put(shost);
return rc;
}
EXPORT_SYMBOL_GPL(hisi_sas_probe);
@@ -2006,7 +2006,7 @@ int hisi_sas_remove(struct platform_device *pdev)
sas_remove_host(sha->core.shost);
hisi_sas_free(hisi_hba);
- kfree(shost);
+ scsi_host_put(shost);
return 0;
}
EXPORT_SYMBOL_GPL(hisi_sas_remove);
OpenPOWER on IntegriCloud