Skip to content
Snippets Groups Projects
Commit 5f170532 authored by Naseer Ahmed's avatar Naseer Ahmed Committed by Nick Desaulniers
Browse files

msm: mdss: Add lock to avoid release of active session in rotator


Add mutex lock to protect an active rotator session from being closed.
Without the lock, this can happen if a rotator closing IOCTL is
called from a separate thread.

CRs-Fixed: 2006159
Bug: 34328139
Change-Id: I927a0c626bdae5ef149e12979ec4befdbac1b7f7
Signed-off-by: default avatarBenjamin Chan <bkchan@codeaurora.org>
Signed-off-by: default avatarNaseer Ahmed <naseer@codeaurora.org>
parent 9415b7c3
Branches
Tags
No related merge requests found
/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
......@@ -2073,10 +2073,12 @@ static int mdss_rotator_config_session(struct mdss_rot_mgr *mgr,
return ret;
}
mutex_lock(&mgr->lock);
perf = mdss_rotator_find_session(private, config.session_id);
if (!perf) {
pr_err("No session with id=%u could be found\n",
config.session_id);
mutex_unlock(&mgr->lock);
return -EINVAL;
}
......@@ -2099,6 +2101,7 @@ static int mdss_rotator_config_session(struct mdss_rot_mgr *mgr,
config.output.format);
done:
ATRACE_END(__func__);
mutex_unlock(&mgr->lock);
return ret;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment