]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: ufs: bsg: Delete bsg_dev when setting up bsg fails
authorGuixin Liu <kanie@linux.alibaba.com>
Wed, 18 Dec 2024 01:42:13 +0000 (09:42 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 10 Jan 2025 23:03:35 +0000 (18:03 -0500)
We should remove the bsg device when bsg_setup_queue() fails to release the
resources.

Fixes: df032bf27a41 ("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>
drivers/ufs/core/ufs_bsg.c

index 6c09d97ae00658333b491dc2d4a6bcd21dceb6a1..58023f735c195fa60137192f37c23a90ca51c418 100644 (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;
        }