public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* scsi: hisi_sas: replace kfree with scsi_host_put
@ 2017-08-08 11:37 Pan Bian
  2017-08-08 14:56 ` John Garry
  0 siblings, 1 reply; 3+ messages in thread
From: Pan Bian @ 2017-08-08 11:37 UTC (permalink / raw)
  To: John Garry, James E.J. Bottomley, Martin K. Petersen
  Cc: linux-scsi, linux-kernel, Pan Bian

Return value of scsi_host_alloc() should be released with
scsi_host_put() rather than kfree().

Signed-off-by: Pan Bian <bianpan2016@163.com>
---
 drivers/scsi/hisi_sas/hisi_sas_main.c | 6 +++---
 1 file 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 4022c3f..22d8922 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -1825,7 +1825,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;
 }
@@ -1916,7 +1916,7 @@ int hisi_sas_probe(struct platform_device *pdev,
 	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);
@@ -1931,7 +1931,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);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-08 15:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-08 11:37 scsi: hisi_sas: replace kfree with scsi_host_put Pan Bian
2017-08-08 14:56 ` John Garry
2017-08-08 15:12   ` PanBian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox