From: Rob Clark <rob.clark@oss.qualcomm.com>
To: Wentao Liang <vulab@iscas.ac.cn>
Cc: abhinav.kumar@linux.dev, airlied@gmail.com,
dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org,
jesszhan0024@gmail.com, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, lumag@kernel.org,
marijn.suijten@somainline.org, sean@poorly.run, simona@ffwll.ch,
stable@vger.kernel.org
Subject: Re: [PATCH] drm/msm/dsi: Fix VM leak in dsi_tx_buf_alloc_6g()
Date: Sat, 26 Sep 2026 08:23:43 -0700 [thread overview]
Message-ID: <CACSVV01+7xbVKDS1SOJOpuAw4WojvxRa25fUVZZT6o7hVcNOXw@mail.gmail.com> (raw)
In-Reply-To: <20260916175738.2089950-1-vulab@iscas.ac.cn>
On Wed, Sep 16, 2026 at 10:58 AM Wentao Liang <vulab@iscas.ac.cn> wrote:
>
> dsi_tx_buf_alloc_6g() takes a reference to the kms VM with
> drm_gpuvm_get() and stores it in msm_host->vm. If
> msm_gem_kernel_new() fails, the function returns early without
> dropping that reference. Since msm_host->tx_gem_obj is cleared on
> the error path, msm_dsi_tx_buf_free() will never see a non-NULL
> tx_gem_obj and thus never calls drm_gpuvm_put(), leaking the VM
> reference.
>
> Drop the VM reference and clear msm_host->vm on the error path.
>
> Fixes: 5e05be782645 ("drm/msm/dsi: free TX buffer in unbind")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Reviewed-by: Rob Clark <rob.clark@oss.qualcomm.com>
> ---
> drivers/gpu/drm/msm/dsi/dsi_host.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
> index 982abaaac00d..29e0de0e0c22 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
> @@ -1250,6 +1250,8 @@ int dsi_tx_buf_alloc_6g(struct msm_dsi_host *msm_host, int size)
>
> if (IS_ERR(data)) {
> msm_host->tx_gem_obj = NULL;
> + drm_gpuvm_put(msm_host->vm);
> + msm_host->vm = NULL;
> return PTR_ERR(data);
> }
>
> --
> 2.34.1
>
next prev parent reply other threads:[~2026-09-26 15:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 17:57 Wentao Liang
2026-09-26 15:23 ` Rob Clark [this message]
2026-10-03 0:46 ` Dmitry Baryshkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACSVV01+7xbVKDS1SOJOpuAw4WojvxRa25fUVZZT6o7hVcNOXw@mail.gmail.com \
--to=rob.clark@oss.qualcomm.com \
--cc=abhinav.kumar@linux.dev \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jesszhan0024@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lumag@kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=sean@poorly.run \
--cc=simona@ffwll.ch \
--cc=stable@vger.kernel.org \
--cc=vulab@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®