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>
Thu, 25 Aug 2022 09:11:21 +0000 (11:11 +0200)
commit155479cd67246f3062c4645a012e3f7630789fe4
tree595ef630fc525cd0c1f9e19d8ee9595cc386553d
parent591ab8dbf6c21927f23f83ddb90691f48b86d136
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/mfd/rtsx_pcr.c