mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 06:25:52 +02:00
drm/msm: fix potential memleak in error branch
[ Upstream commit 177d381963 ]
In function msm_submitqueue_create, the queue is a local
variable, in return -EINVAL branch, queue didn`t add to ctx`s
list yet, and also didn`t kfree, this maybe bring in potential
memleak.
Signed-off-by: Bernard Zhao <bernard@vivo.com>
[trivial commit msg fixup]
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
d4d0e6c07b
commit
bf59aa00e4
|
|
@ -78,8 +78,10 @@ int msm_submitqueue_create(struct drm_device *drm, struct msm_file_private *ctx,
|
|||
queue->flags = flags;
|
||||
|
||||
if (priv->gpu) {
|
||||
if (prio >= priv->gpu->nr_rings)
|
||||
if (prio >= priv->gpu->nr_rings) {
|
||||
kfree(queue);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
queue->prio = prio;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user