[<prev] [next>] [day] [month] [year] [list]
Message-ID: <25de6764b32724eac554d48d17d23c50bb862693.1741508504.git.christophe.jaillet@wanadoo.fr>
Date: Sun, 9 Mar 2025 09:22:05 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Michał Mirosław <mirq-linux@...e.qmqm.pl>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Pierre Ossman <pierre@...man.eu>
Cc: linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: [PATCH] mmc: cb710: Fix an error handling path in cb710_probe()
If an error occurs after a successful ida_alloc() call, it should be undone
by a corresponding ida_free(), as already done in the remove function.
Add the missing call in the error handling path of cb710_probe().
Fixes: 5f5bac8272be ("mmc: Driver for CB710/720 memory card reader (MMC part)")
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
drivers/misc/cb710/core.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/misc/cb710/core.c b/drivers/misc/cb710/core.c
index 55b7ee0e8f93..394fc2488029 100644
--- a/drivers/misc/cb710/core.c
+++ b/drivers/misc/cb710/core.c
@@ -250,7 +250,7 @@ static int cb710_probe(struct pci_dev *pdev,
err = cb710_register_slot(chip,
CB710_SLOT_MMC, 0x00, "cb710-mmc");
if (err)
- return err;
+ goto free_platform_id;
}
if (val & CB710_SLOT_MS) { /* MemoryStick slot */
@@ -276,6 +276,10 @@ static int cb710_probe(struct pci_dev *pdev,
#ifdef CONFIG_CB710_DEBUG_ASSUMPTIONS
BUG_ON(atomic_read(&chip->slot_refs_count) != 0);
#endif
+
+free_platform_id:
+ ida_free(&cb710_ida, chip->platform_id);
+
return err;
}
--
2.48.1
Powered by blists - more mailing lists