Re: [PATCH] RDMA/mlx5: Fix memory leak in GET_DATA_DIRECT_SYSFS_PATH handler
From: Markus Elfring
Date: Mon Jan 26 2026 - 04:31:41 EST
…
> Add a kfree() call to the error path to ensure the allocated memory is
> properly freed.
…
How do you think about to use an additional label in the affected if branch instead?
https://elixir.bootlin.com/linux/v6.19-rc5/source/drivers/infiniband/hw/mlx5/std_types.c#L189-L231
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.19-rc7#n526
See also once more:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/stable-kernel-rules.rst?h=v6.19-rc7#n34
Regards,
Markus