Unverified Commit bda95db8 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!9197 scsi: core: Fix unremoved procfs host directory regression

parents ec00c674 d13fffdc
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -335,12 +335,13 @@ static void scsi_host_dev_release(struct device *dev)

	if (shost->shost_state == SHOST_CREATED) {
		/*
		 * Free the shost_dev device name here if scsi_host_alloc()
		 * and scsi_host_put() have been called but neither
		 * Free the shost_dev device name and remove the proc host dir
		 * here if scsi_host_{alloc,put}() have been called but neither
		 * scsi_host_add() nor scsi_host_remove() has been called.
		 * This avoids that the memory allocated for the shost_dev
		 * name is leaked.
		 * name as well as the proc dir structure are leaked.
		 */
		scsi_proc_hostdir_rm(shost->hostt);
		kfree(dev_name(&shost->shost_dev));
	}