On Fri, Jun 30, 2023 at 09:49:03AM +0800, Zhengchao Shao wrote: > When kvzalloc_node or kvzalloc failed in mlx5e_ptp_open, the memory > pointed by "c" or "cparams" is not freed, which can lead to a memory > leak. Fix by freeing the array in the error path. > > Fixes: 145e5637d941 ("net/mlx5e: Add TX PTP port object support") > Signed-off-by: Zhengchao Shao <shaozhengchao@xxxxxxxxxx> > Reviewed-by: Rahul Rameshbabu <rrameshbabu@xxxxxxxxxx> > Reviewed-by: Gal Pressman <gal@xxxxxxxxxx> Reviewed-by: Simon Horman <simon.horman@xxxxxxxxxxxx>