scsi: sd: Free scsi_disk device via put_device()
authorMing Lei <ming.lei@redhat.com>
Mon, 6 Sep 2021 09:01:12 +0000 (17:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 Oct 2021 12:40:56 +0000 (14:40 +0200)
commit60df9f55562a57173a11b6c7011eee40dfa48157
treee41e8ac43a8d0cfe4acd8c037f3bd5d23ba1dea0
parent76c7063c7405f30758876af25cfc5e9e39b7bc6e
scsi: sd: Free scsi_disk device via put_device()

[ Upstream commit 265dfe8ebbabae7959060bd1c3f75c2473b697ed ]

After a device is initialized via device_initialize() it should be freed
via put_device(). sd_probe() currently gets this wrong, fix it up.

Link: https://lore.kernel.org/r/20210906090112.531442-1-ming.lei@redhat.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/sd.c