# Re: \[PATCH v2 net\] sfc: fix potential memory leak in efx\_mae\_process\_mport()

- From: Jacob Keller \<jacob.e.keller@intel.com\>
- Date: 2025-10-24 00:48:18 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/10/3265044
- Thread: https://ratatoskr.run/netdev/2025/10/3264320/t.md

```text


On 10/23/2025 7:18 AM, Abdun Nihaal wrote:
> In efx_mae_enumerate_mports(), memory allocated for mae_mport_desc is
> passed as a argument to efx_mae_process_mport(), but when the error path
> in efx_mae_process_mport() gets executed, the memory allocated for desc
> gets leaked.
> 
> Fix that by freeing the memory allocation before returning error.
> 

Why not make the caller responsible for freeing desc on failure?
```

## Attachments

- [OpenPGP\_signature.asc](https://ratatoskr.run/netdev/2025/10/3265044/attachment/0) (application/pgp-signature, 236 bytes)
