ta: os_test: do not call TEE_CloseTASession() if session is not opened

The Global Platform specification [1] tells us that the session
parameter of TEE_CloseTASession() is:

  An opened session handle

The behaviour is unspecified if the session handle is not opened.

Make sure not to call TEE_CloseTASession() with an invalid session
handle when TEE_OpenTASession() fails by either:

  - doing an early return
  - adding an additional cleanup label

[1] TEE Internal Core API Specification – Public Release v1.3.1,
    §4.9.2 "TEE_CloseTASession"

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
1 file changed
tree: d4828818f36e278b39d155a96196c9a7c4e49156
  1. .github/
  2. cert/
  3. host/
  4. scripts/
  5. ta/
  6. .gitignore
  7. Android.mk
  8. CMakeLists.txt
  9. CMakeToolchain.txt
  10. LICENSE.md
  11. Makefile
  12. README.md
  13. typedefs.checkpatch
README.md

OP-TEE sanity testsuite

This git contains source code for the test suite (xtest) used to test the OP-TEE project.

All official OP-TEE documentation has moved to http://optee.readthedocs.io. The information that used to be here in this git can be found under optee_test.

// OP-TEE core maintainers