mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-07 00:59:06 +00:00
tee: fix put order in teedev_close_context()
Prior to this patch was teedev_close_context() calling tee_device_put()
before teedev_ctx_put() leading to teedev_ctx_release() accessing
ctx->teedev just after the reference counter was decreased on the
teedev. Fix this by calling teedev_ctx_put() before tee_device_put().
Fixes: 217e0250cc
("tee: use reference counting for tee_context")
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
This commit is contained in:
parent
ff5fdc34d0
commit
f18397ab3a
1 changed files with 3 additions and 1 deletions
|
@ -98,8 +98,10 @@ void teedev_ctx_put(struct tee_context *ctx)
|
||||||
|
|
||||||
static void teedev_close_context(struct tee_context *ctx)
|
static void teedev_close_context(struct tee_context *ctx)
|
||||||
{
|
{
|
||||||
tee_device_put(ctx->teedev);
|
struct tee_device *teedev = ctx->teedev;
|
||||||
|
|
||||||
teedev_ctx_put(ctx);
|
teedev_ctx_put(ctx);
|
||||||
|
tee_device_put(teedev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tee_open(struct inode *inode, struct file *filp)
|
static int tee_open(struct inode *inode, struct file *filp)
|
||||||
|
|
Loading…
Reference in a new issue