drm/msm: fix potential memleak in error branch
authorBernard Zhao <bernard@vivo.com>
Fri, 12 Jun 2020 01:23:49 +0000 (09:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jul 2020 07:33:58 +0000 (09:33 +0200)
commite1a5b8403617aa986ca0e0ae01e4980877cee9ea
tree6a89b2a294a28e1f5e1adc67d1bce77686cb6324
parent1c06a0be5d3b0352f2cbdb457a3766bc9f9fa6eb
drm/msm: fix potential memleak in error branch

[ Upstream commit 177d3819633cd520e3f95df541a04644aab4c657 ]

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>
drivers/gpu/drm/msm/msm_submitqueue.c