From: Dan Carpenter <dan.carpenter@linaro.org>
To: linan666@huaweicloud.com
Cc: richard@nod.at, miquel.raynal@bootlin.com, vigneshr@ti.com,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
linan122@huawei.com, yukuai3@huawei.com, yi.zhang@huawei.com,
houtao1@huawei.com, yangerkun@huawei.com
Subject: Re: [PATCH v2] ubi: block: fix memleak in ubiblock_create()
Date: Mon, 15 Apr 2024 09:33:22 +0300 [thread overview]
Message-ID: <79703e8b-ce3a-4407-9750-05f9202039d4@moroto.mountain> (raw)
In-Reply-To: <20231208074629.1656356-1-linan666@huaweicloud.com>
On Fri, Dec 08, 2023 at 03:46:29PM +0800, linan666@huaweicloud.com wrote:
> From: Li Nan <linan122@huawei.com>
>
> If idr_alloc() fails, dev->gd will be put after goto out_cleanup_disk in
> ubiblock_create(), but dev->gd has not been assigned yet at this time, and
> 'gd' will not be put anymore. Fix it by putting 'gd' directly.
>
There is another invalid reference to dev->gd if blk_mq_alloc_tag_set()
fails.
dev_err(disk_to_dev(dev->gd), "blk_mq_alloc_tag_set failed");
^^^^^^^
regards,
dan carpenter
next prev parent reply other threads:[~2024-04-15 6:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-08 7:46 linan666
2023-12-30 6:33 ` Li Nan
2024-01-29 13:27 ` Li Nan
2024-04-14 9:16 ` Markus Elfring
2024-04-15 1:31 ` Li Nan
2024-04-15 6:33 ` Dan Carpenter [this message]
2024-04-18 9:07 ` Li Nan
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=79703e8b-ce3a-4407-9750-05f9202039d4@moroto.mountain \
--to=dan.carpenter@linaro.org \
--cc=houtao1@huawei.com \
--cc=linan122@huawei.com \
--cc=linan666@huaweicloud.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=vigneshr@ti.com \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai3@huawei.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®