Subject: Re: [PATCH] netdevsim: Fix memory leak of nsim_dev->fa_cookie

From: Jakub Kicinski <[email-masked]>
Date: Mon, 14 Nov 2022 20:48:39 -0800

On Tue, 15 Nov 2022 11:38:26 +0800 wangyufen wrote:
> Sorry, I didn't make it clear.
> 
> The detailed process of nsim_dev_trap_report_work() is as follows:
> 
> nsim_dev_trap_report_work()
>    nsim_dev_trap_report_work()
>      ...
>      devlink_trap_report()
>        devlink_trap_report_metadata_set()
>        <-- fa_cookie is assigned to metadata->fa_cookie here， and will be freed in net_dm_hw_metadata_free()

What's assigned here and freed in net_dm_hw_metadata_free() is a copy
made with net_dm_hw_metadata_copy(), no?  
Could you double check the whole path?