[FOSS_TLK]security: tlk_driver: Free session when open fails
Aaron Gamble [Wed, 4 Feb 2015 01:07:08 +0000 (17:07 -0800)]
kfree(session) when te_open_session fails.

Coverity id : 28280

Change-Id: Ib6d1a88774c38053c9bb94e76c78b30460bd1204
Signed-off-by: Aaron Gamble <jgamble@nvidia.com>
Reviewed-on: http://git-master/r/755010
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Tested-by: Varun Wadekar <vwadekar@nvidia.com>

security/tlk_driver/ote_comms.c

index ddeea51..1c1ee2e 100644 (file)
@@ -463,6 +463,8 @@ void te_open_session(struct te_opensession *cmd,
        if (request->result) {
                /* release any persistent mem buffers if we failed */
                te_release_mem_buffers(&session->inactive_persist_shmem_list);
+
+               kfree(session);
        } else {
                /* otherwise mark active any persistent mem buffers */
                te_activate_persist_mem_buffers(session);