From: Bo Liu <liubo03@inspur.com>
To: <dan.j.williams@intel.com>, <vishal.l.verma@intel.com>,
<dave.jiang@intel.com>, <ira.weiny@intel.com>
Cc: <nvdimm@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
Bo Liu <liubo03@inspur.com>
Subject: [PATCH] nvdimm: Call ida_simple_remove() when failed
Date: Wed, 10 Aug 2022 02:07:37 -0400 [thread overview]
Message-ID: <20220810060737.5087-1-liubo03@inspur.com> (raw)
In function nvdimm_bus_register(), when code execution fails, we should
call ida_simple_remove() to free ida.
Signed-off-by: Bo Liu <liubo03@inspur.com>
---
drivers/nvdimm/bus.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c
index b38d0355b0ac..3415dc62632b 100644
--- a/drivers/nvdimm/bus.c
+++ b/drivers/nvdimm/bus.c
@@ -371,6 +371,7 @@ struct nvdimm_bus *nvdimm_bus_register(struct device *parent,
return nvdimm_bus;
err:
put_device(&nvdimm_bus->dev);
+ ida_simple_remove(&nd_ida, nvdimm_bus->id);
return NULL;
}
EXPORT_SYMBOL_GPL(nvdimm_bus_register);
--
2.27.0
next reply other threads:[~2022-08-10 6:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-10 6:07 Bo Liu [this message]
2022-09-20 17:32 ` Dan Williams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220810060737.5087-1-liubo03@inspur.com \
--to=liubo03@inspur.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=ira.weiny@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--cc=vishal.l.verma@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®