diff options
author | Jakub Kicinski <kuba@kernel.org> | 2023-06-06 12:43:01 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-06-07 12:53:10 -0700 |
commit | 58da455b31baf87dd74b71fc54d0356e05c0bf49 (patch) | |
tree | a16642c51d329b448b9a873cd5a41784df22d2bb /drivers | |
parent | 2cc9671a82e3ba8911f01b04fd8f8f2da3a238a7 (diff) |
tools: ynl-gen: improve unwind on parsing errors
When parsing multi-attr we count the objects and then allocate
an array to hold the parsed objects. If an attr space has multiple
multi-attr objects, however, if parsing the first array fails
we'll leave the object count for the second even tho the second
array was never allocated.
This may cause crashes when freeing objects on error.
Count attributes to a variable on the stack and only set the count
in the object once the memory was allocated.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions