misc: rtsx: Fix an error handling path in rtsx_pci_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Wed, 15 Jun 2022 05:33:44 +0000 (07:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:45 +0000 (14:23 +0200)
commit80169b136c897e46fd86c7f73fb709f8a48a744e
treeeac204f223e8bc20e5996f4d213d85a2ca3c18eb
parent30f44ddfdb4958eb4477eceeff6411974dc86a3f
misc: rtsx: Fix an error handling path in rtsx_pci_probe()

[ Upstream commit 44fd1917314e9d4f53dd95dd65df1c152f503d3a ]

If an error occurs after a successful idr_alloc() call, the corresponding
resource must be released with idr_remove() as already done in the .remove
function.

Update the error handling path to add the missing idr_remove() call.

Fixes: ada8a8a13b13 ("mfd: Add realtek pcie card reader driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/e8dc41716cbf52fb37a12e70d8972848e69df6d6.1655271216.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/cardreader/rtsx_pcr.c