summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/gecko.py
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-04-15 00:18:46 +0300
committerJakub Kicinski <kuba@kernel.org>2025-04-17 04:09:41 +0300
commitce6cb8113c842b94e77364b247c4f85c7b34e0c2 (patch)
tree1a99f0ef128e10631b8ea9624187fdb8f3cb00b4 /tools/perf/scripts/python/gecko.py
parentdfa464b4a603984d648a9beb9bce72df5858c1e2 (diff)
downloadlinux-ce6cb8113c842b94e77364b247c4f85c7b34e0c2.tar.xz
tools: ynl-gen: individually free previous values on double set
When user calls request_attrA_set() multiple times (for the same attribute), and attrA is of type which allocates memory - we try to free the previously associated values. For array types (including multi-attr) we have only freed the array, but the array may have contained pointers. Refactor the code generation for free attr and reuse the generated lines in setters to flush out the previous state. Since setters are static inlines in the header we need to add forward declarations for the free helpers of pure nested structs. Track which types get used by arrays and include the right forwad declarations. At least ethtool string set and bit set would not be freed without this. Tho, admittedly, overriding already set attribute twice is likely a very very rare thing to do. Fixes: be5bea1cc0bf ("net: add basic C code generators for Netlink") Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://patch.msgid.link/20250414211851.602096-4-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/gecko.py')
0 files changed, 0 insertions, 0 deletions