mbox series

[0/2] fix some bsg related bugs

Message ID 20241217105840.120081-1-kanie@linux.alibaba.com
Headers show
Series fix some bsg related bugs | expand

Message

Guixin Liu Dec. 17, 2024, 10:58 a.m. UTC
Guixin Liu (2):
  scsi: ufs: delete bsg_dev when setup bsg fail
  scsi: ufs: set bsg_queue to NULL after remove

 drivers/ufs/core/ufs_bsg.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Avri Altman Dec. 17, 2024, 11:33 a.m. UTC | #1
> We should remove the bsg device when bsg_setup_queue() return fail to
> release the resources.
> 


Fixes: 
> Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Once added, please add my Reviewed-by.

Thanks,
Avri

> ---
>  drivers/ufs/core/ufs_bsg.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/ufs/core/ufs_bsg.c b/drivers/ufs/core/ufs_bsg.c index
> 6c09d97ae006..58023f735c19 100644
> --- a/drivers/ufs/core/ufs_bsg.c
> +++ b/drivers/ufs/core/ufs_bsg.c
> @@ -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;
>         }
> 
> --
> 2.43.0