Skip to content
Commit b83685bc authored by Dan Carpenter's avatar Dan Carpenter Committed by Jens Wiklander
Browse files

tee: amdtee: fix memory leak in amdtee_open_session()



On these error paths the "sess" variable isn't freed.  It's a refcounted
pointer so we need to call kref_put().  I re-arranged the code a bit so
the error case is always handled before the success case and the error
paths are indented two tabs.

Fixes: 757cc3e9 ("tee: add AMD-TEE driver")
Reviewed-by: default avatarRijo Thomas <Rijo-john.Thomas@amd.com>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJens Wiklander <jens.wiklander@linaro.org>
parent 11a48a5a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment