diff options
| author | Lloyd Atkinson <latkinso@codeaurora.org> | 2016-10-04 09:47:46 -0400 |
|---|---|---|
| committer | Lloyd Atkinson <latkinso@codeaurora.org> | 2016-10-31 09:34:02 -0400 |
| commit | d7d9bace81c7fa631c63b32bb9206467eb3f6bc2 (patch) | |
| tree | eddc265ca711688c6e288d21b56fe3f0eb390ff9 | |
| parent | 894781088ebcf44bbeb79610834eee64dd3eda2a (diff) | |
drm/msm/sde: remove static allocation of mdp_top hw block
Remove singleton behavior from mdp_top hardware block since it
is no longer necessary. The resource manager now manages the
lifecycle of the mdp_top. This fixes an issue where the static
mdp_top would point to freed memory.
Change-Id: Ie860fd65ac2efa28ed0f3d9014bb45b0cc6aed5e
Signed-off-by: Lloyd Atkinson <latkinso@codeaurora.org>
| -rw-r--r-- | drivers/gpu/drm/msm/sde/sde_hw_top.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/gpu/drm/msm/sde/sde_hw_top.c b/drivers/gpu/drm/msm/sde/sde_hw_top.c index 8950a60c0d68..10d39177345d 100644 --- a/drivers/gpu/drm/msm/sde/sde_hw_top.c +++ b/drivers/gpu/drm/msm/sde/sde_hw_top.c @@ -141,34 +141,31 @@ struct sde_hw_mdp *sde_hw_mdptop_init(enum sde_mdp idx, void __iomem *addr, const struct sde_mdss_cfg *m) { - static struct sde_hw_mdp *c; + struct sde_hw_mdp *mdp; const struct sde_mdp_cfg *cfg; - /* mdp top is singleton */ - if (c) - return c; - - c = kzalloc(sizeof(*c), GFP_KERNEL); - if (!c) + mdp = kzalloc(sizeof(*mdp), GFP_KERNEL); + if (!mdp) return ERR_PTR(-ENOMEM); - cfg = _top_offset(idx, m, addr, &c->hw); + cfg = _top_offset(idx, m, addr, &mdp->hw); if (IS_ERR_OR_NULL(cfg)) { - kfree(c); + kfree(mdp); return ERR_PTR(-EINVAL); } /* * Assign ops */ - c->idx = idx; - c->cap = cfg; - _setup_mdp_ops(&c->ops, c->cap->features); + mdp->idx = idx; + mdp->cap = cfg; + _setup_mdp_ops(&mdp->ops, mdp->cap->features); /* * Perform any default initialization for the intf */ - return c; + + return mdp; } void sde_hw_mdp_destroy(struct sde_hw_mdp *mdp) |
