Skip to content

Commit 2bccda7

Browse files
guixinliu1995SherryYang1
authored andcommitted
scsi: ufs: bsg: Delete bsg_dev when setting up bsg fails
[ Upstream commit fcf247d ] We should remove the bsg device when bsg_setup_queue() fails to release the resources. Fixes: df032bf ("scsi: ufs: Add a bsg endpoint that supports UPIUs") Signed-off-by: Guixin Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Avri Altman <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit b4beb4a96e22b7bd1ddc153786bf3e89423afd45) Signed-off-by: Sherry Yang <[email protected]>
1 parent 56c8535 commit 2bccda7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/scsi/ufs/ufs_bsg.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ int ufs_bsg_probe(struct ufs_hba *hba)
213213
q = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), ufs_bsg_request, NULL, 0);
214214
if (IS_ERR(q)) {
215215
ret = PTR_ERR(q);
216+
device_del(bsg_dev);
216217
goto out;
217218
}
218219

0 commit comments

Comments
 (0)