Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix make memcheck #2785

Merged
merged 22 commits into from
Jan 26, 2025
Merged

Fix make memcheck #2785

merged 22 commits into from
Jan 26, 2025

Conversation

jimklimov
Copy link
Member

Follows up from #2781

Some fixes are for valgrind suppression rules to not complain about CPPUNIT per se, others are actual bugs found in code.

jimklimov and others added 22 commits January 25, 2025 18:44
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…e the helper script a template

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… option

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…NIT leaky internals)

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…opened DIRFD

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ix memory leak with temporary BoolInt instances

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…o avoid use after free

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… which we did not upsdrv_init()

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…T coding style

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…once

Check if (gpioupsfd!=NULL) and nullify it afterwards.
Should not be a problem in the real driver, but confused
the repetitive use of this code in unit test case.

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…o occasionally repeat the attempt

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…cal->rules) itself too, not just entries in the list

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…or generic_gpio_close() to take a pointer to pointer and nullify it

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…code is freed before we (re?)init it in test

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…mize

* Less lookups to testval/getval
* Do not xalloc and fatalx if got no rules (avoid leak)

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… driver code is freed before we (re?)init it in test"

This reverts commit bf59f10.

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…TOOL values

Signed-off-by: Jim Klimov <jimklimov@gmail.com>
@jimklimov jimklimov added bug C++ GPIO Drivers talking to devices (or their chips) over GPIO interface labels Jan 25, 2025
@jimklimov jimklimov added this to the 2.8.3 milestone Jan 25, 2025
@jimklimov jimklimov merged commit e841840 into networkupstools:master Jan 26, 2025
30 checks passed
@jimklimov jimklimov deleted the fix-memcheck branch January 26, 2025 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug C++ GPIO Drivers talking to devices (or their chips) over GPIO interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant