scsi: ufs: bsg: Delete bsg_dev when setting up bsg fails
[ Upstream commitfcf247deb3] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
495dcb00d4
commit
e5565240c6
@@ -256,6 +256,7 @@ int ufs_bsg_probe(struct ufs_hba *hba)
|
||||
q = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), ufs_bsg_request, NULL, 0);
|
||||
if (IS_ERR(q)) {
|
||||
ret = PTR_ERR(q);
|
||||
device_del(bsg_dev);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user