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

rimage: elf_file: Fix elf_free behavior on unopened elf file #8530

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

softwarecki
Copy link
Collaborator

If more modules are provided in a command line than defined in a toml file, the program outputs an error message. It frees the module structures even though they have not been opened before. This resulted in an error when trying to close a file that was not previously open. Added a check to ensure that a file has been opened before trying to close it. Error handling in the elf_open function has been simplified.

Fixed a little issue introduced by oversight. The error message in module_write_whole_elf function did not use the file name passed as a parameter.

If more modules are provided in a command line than defined in a toml file,
the program outputs an error message. It frees the module structures
even though they have not been opened before. This resulted in an error
when trying to close a file that was not previously open. Added a check to
ensure that a file has been opened before trying to close it.
Error handling in the elf_open function has been simplified.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
By oversight, the error message did not use the file name passed as a
parameter to the module_write_whole_elf function.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Copy link

@ArsenEloglian ArsenEloglian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me 👌🏻

@kv2019i kv2019i merged commit 2b4e484 into thesofproject:main Nov 28, 2023
44 of 45 checks passed
@softwarecki softwarecki deleted the rimage-fix-elf branch March 4, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rimage Issues related to rimage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants