lkml.org 
[lkml]   [2024]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2] ubi: block: fix memleak in ubiblock_create()
From
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


\
 
 \ /
  Last update: 2024-05-27 16:44    [W:0.208 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site