mdss: mdp: Prevent accessing uninitialized rot_session_mgr

There are situations where mdss_mdp_rotator_release_all is called
and rotator session manager is not initialized. Added error
checking to prevent crashing.

Change-Id: I104fa88dd41bb4bad3a0402cf6955c85f640e384
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
This commit is contained in:
Terence Hampson 2015-03-26 15:29:03 -04:00 committed by David Keitel
parent fe0e12f81c
commit 9c7a81c5b7

View file

@ -978,6 +978,10 @@ int mdss_mdp_rotator_release(struct mdss_mdp_rotator_session *rot)
int mdss_mdp_rotator_release_all(void)
{
struct mdss_mdp_rotator_session *rot;
if (!rot_mgr) {
pr_debug("rot manager not initialized\n");
return -EINVAL;
}
while (true) {
rot = mdss_mdp_rot_mgr_remove_first();