scsi: ufs: bsg: Delete bsg_dev when setting up bsg fails

We should remove the bsg device when bsg_setup_queue() fails to release the
resources.

Fixes: df032bf27a ("scsi: ufs: Add a bsg endpoint that supports UPIUs")
Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Link: https://lore.kernel.org/r/20241218014214.64533-2-kanie@linux.alibaba.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Guixin Liu
2024-12-18 09:42:13 +08:00
committed by Martin K. Petersen
parent 98b37881b7
commit fcf247deb3

View File

@@ -257,6 +257,7 @@ int ufs_bsg_probe(struct ufs_hba *hba)
NULL, 0);
if (IS_ERR(q)) {
ret = PTR_ERR(q);
device_del(bsg_dev);
goto out;
}