Re: [PATCH] scsi: sd: unregister device if device_add_disk() failed in sd_probe()
From: Martin K. Petersen
Date: Mon Apr 01 2024 - 21:49:28 EST
On Fri, 08 Dec 2023 16:23:35 +0800, linan666@xxxxxxxxxxxxxxx wrote:
> "if device_add() succeeds, you should call device_del() when you want to
> get rid of it."
>
> In sd_probe(), device_add_disk() fails when device_add() has already
> succeeded, so change put_device() to device_unregister() to ensure device
> resources are released.
>
> [...]
Applied to 6.9/scsi-fixes, thanks!
[1/1] scsi: sd: unregister device if device_add_disk() failed in sd_probe()
https://git.kernel.org/mkp/scsi/c/0296bea01cfa
--
Martin K. Petersen Oracle Linux Engineering