diff options
| author | Vincenzo Mezzela <[email protected]> | 2024-06-07 16:33:50 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2024-06-11 07:31:04 +0000 |
| commit | 880f5f58fd1aa22540d7e24693f411f6416b86d3 (patch) | |
| tree | 76c8afbe45616a5a56e9e9810321c1cd46496c0c /drivers/net/ethernet/intel/ice/ice_ptp.c | |
| parent | drivers: arch_topology: Refactor do-while loops (diff) | |
| download | kernel-880f5f58fd1aa22540d7e24693f411f6416b86d3.tar.gz kernel-880f5f58fd1aa22540d7e24693f411f6416b86d3.zip | |
drivers: arch_topology: use __free attribute instead of of_node_put()
Introduce the __free attribute for scope-based resource management.
Resources allocated with __free are automatically released at the end of
the scope. This enhancement aims to mitigate memory management issues
associated with forgetting to release resources by utilizing __free
instead of of_node_put().
The declaration of the device_node used within the do-while loops is
moved directly within the loop so that the resource is automatically
freed at the end of each iteration.
Acked-by: Sudeep Holla <[email protected]>
Suggested-by: Julia Lawall <[email protected]>
Signed-off-by: Vincenzo Mezzela <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_ptp.c')
0 files changed, 0 insertions, 0 deletions
