[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fc38cd3b-9e48-6787-afe6-1c991a7186ca@huawei.com>
Date: Tue, 23 Mar 2021 16:14:03 +0800
From: Zhiqiang Liu <liuzhiqiang26@...wei.com>
To: Wu Bo <wubo40@...wei.com>, <rjw@...ysocki.net>, <lenb@...nel.org>,
<bhelgaas@...gle.com>
CC: <linux-acpi@...r.kernel.org>, <linux-pci@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, linfeilong <linfeilong@...wei.com>
Subject: Re: [PATCH] pci: fix memory leak when virtio pci hotplug
friendly ping..
On 2021/3/22 10:43, Wu Bo wrote:
> On 2021/3/21 23:29, Zhiqiang Liu wrote:
>> From: Feilong Lin <linfeilong@...wei.com>
>>
>> Repeated hot-plugging of pci devices for a virtual
>> machine driven by virtio, we found that there is a
>> leak in kmalloc-4k, which was confirmed as the memory
>> of the pci_device structure. Then we found out that
>> it was missing pci_dev_put() after pci_get_slot() in
>> enable_slot() of acpiphp_glue.c.
>>
>> Signed-off-by: Feilong Lin <linfeilong@...wei.com>
>> Reviewed-by: Zhiqiang Liu <liuzhiqiang26@...wei.com>
>> ---
>> drivers/pci/hotplug/acpiphp_glue.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
>> index 3365c93abf0e..f031302ad401 100644
>> --- a/drivers/pci/hotplug/acpiphp_glue.c
>> +++ b/drivers/pci/hotplug/acpiphp_glue.c
>> @@ -533,6 +533,7 @@ static void enable_slot(struct acpiphp_slot *slot, bool bridge)
>> slot->flags &= ~SLOT_ENABLED;
>> continue;
>> }
>> + pci_dev_put(dev);
>> }
>> }
>>
> Reviewed-by: Wu Bo <wubo40@...wei.com>
>
> .
Powered by blists - more mailing lists