Linux-mtd Archive mirror
 help / color / mirror / Atom feed
From: Li Nan <linan666@huaweicloud.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
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: Thu, 18 Apr 2024 17:07:54 +0800	[thread overview]
Message-ID: <6d826865-b296-627c-3f83-e0a18263de7a@huaweicloud.com> (raw)
In-Reply-To: <79703e8b-ce3a-4407-9750-05f9202039d4@moroto.mountain>

Hi, dan,

在 2024/4/15 14:33, Dan Carpenter 写道:
> 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");
>                              ^^^^^^^
> 

You are really very careful! I will fix it later.

> regards,
> dan carpenter

-- 
Thanks,
Nan


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

      reply	other threads:[~2024-04-18  9:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08  7:46 [PATCH v2] ubi: block: fix memleak in ubiblock_create() 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
2024-04-18  9:07   ` Li Nan [this message]

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=6d826865-b296-627c-3f83-e0a18263de7a@huaweicloud.com \
    --to=linan666@huaweicloud.com \
    --cc=dan.carpenter@linaro.org \
    --cc=houtao1@huawei.com \
    --cc=linan122@huawei.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).