- /*Calling optee_disable_shm_cache() in both if and else. It could be
- * Ask OP-TEE to free all cached shared memory objects to decrease
- * reference counters and also avoid wild pointers in secure world
- * into the old shared memory range.
- */
- optee_disable_shm_cache(optee);
+ if (shutdown) {
+ optee_disable_shm_cache(optee);
+ } else {
+ /*
+ * Ask OP-TEE to free all cached shared memory
+ * objects to decrease reference counters and
+ * also avoid wild pointers in secure world
+ * into the old shared memory range.
+ */
+ optee_disable_shm_cache(optee);
put in front of if().
Ideally, I could just use optee_remove for shutdown() too.
But it would not look good. Hence this approach.
What is the problem with using optee_remove() for shutdown()?