lkml.org 
[lkml]   [2021]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -next] NTB: Drop kfree for memory allocated with devm_kzalloc
From
Date


On 10/02/21 1:23 pm, Wei Yongjun wrote:
> It's not necessary to free memory allocated with devm_kzalloc
> and using kfree leads to a double free.
>
> Fixes: 363baf7d6051 ("NTB: Add support for EPF PCI-Express Non-Transparent Bridge")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/ntb/hw/epf/ntb_hw_epf.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/ntb/hw/epf/ntb_hw_epf.c b/drivers/ntb/hw/epf/ntb_hw_epf.c
> index 2cccb7dff5dd..b019755e4e21 100644
> --- a/drivers/ntb/hw/epf/ntb_hw_epf.c
> +++ b/drivers/ntb/hw/epf/ntb_hw_epf.c
> @@ -723,7 +723,6 @@ static void ntb_epf_pci_remove(struct pci_dev *pdev)
> ntb_unregister_device(&ndev->ntb);
> ntb_epf_cleanup_isr(ndev);
> ntb_epf_deinit_pci(ndev);
> - kfree(ndev);
> }

Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
>
> static const struct ntb_epf_data j721e_data = {
>

\
 
 \ /
  Last update: 2021-02-12 14:10    [W:0.049 / U:1.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site