The first patch of this series makes sure in the block device selftest to
free a remaining handles buffer during teardown().
This allows to simplify error handling in the second patch, without fear of
leaking memory.

The second patch's main intent is to test the revision field of all the
block io protocol structures.
This is the test corresponding to the fix in commit 62d7a49c4db6
("lib/efi_loader: fix block io revision").
While we are at it, let's verify the protocol's pointers as well (as
suggested by Heinrich).

Signed-off-by: Vincent Stehlé <[email protected]>
---
Changes for v2:
- Deal gracefully with no block io protocol found.
- Print revision with %u in case of error as it is unsigned.

---
Changes for v3:
- Introduce a preliminary patch to make handles pointer global and free it
  also in teardown(), to simplify error handling.
- Verify handles number and pointer on the normal path.
- Treat block io protocol not found as an error; we installed one during
  setup() therefore we expect at least one.
- Simplify error handling and return in case of error in the loop rather
  than breaking.
- Verify all block io pointers as well.
- Remove leading `lib/' from commit title.

---
Vincent Stehlé (2):
      efi_selftest: free handles on teardown()
      efi_selftest: test block io revision and pointers

 lib/efi_selftest/efi_selftest_block_device.c | 77 +++++++++++++++++++++++++++-
 1 file changed, 76 insertions(+), 1 deletion(-)
---
base-commit: 6902fb4c17faa375003124c451c2550deab5463d
change-id: 20260608-rev-772dedbb2fda

Best regards,
-- 
Vincent.

Reply via email to