From: Daniel Vetter <daniel@ffwll.ch>
To: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Cc: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Dmitry Osipenko <digetx@gmail.com>,
kernel@collabora.com
Subject: Re: [PATCH v7 1/2] drm/shmem-helper: Add missing vunmap on error
Date: Tue, 9 Aug 2022 18:38:16 +0200 [thread overview]
Message-ID: <YvKNeMJjOjy8B+YH@phenom.ffwll.local> (raw)
In-Reply-To: <20220630200058.1883506-2-dmitry.osipenko@collabora.com>
On Thu, Jun 30, 2022 at 11:00:57PM +0300, Dmitry Osipenko wrote:
> The vmapping of dma-buf may succeed, but DRM SHMEM rejects the IOMEM
> mapping, and thus, drm_gem_shmem_vmap_locked() should unvmap the IOMEM
> before erroring out.
>
> Cc: stable@vger.kernel.org
> Fixes: 49a3f51dfeee ("drm/gem: Use struct dma_buf_map in GEM vmap ops and convert GEM backends")
> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Pushed to drm-misc-next-fixes, thanks for your patch.
-Daniel
> ---
> drivers/gpu/drm/drm_gem_shmem_helper.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c
> index 8ad0e02991ca..904fc893c905 100644
> --- a/drivers/gpu/drm/drm_gem_shmem_helper.c
> +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
> @@ -302,6 +302,7 @@ static int drm_gem_shmem_vmap_locked(struct drm_gem_shmem_object *shmem,
> ret = dma_buf_vmap(obj->import_attach->dmabuf, map);
> if (!ret) {
> if (WARN_ON(map->is_iomem)) {
> + dma_buf_vunmap(obj->import_attach->dmabuf, map);
> ret = -EIO;
> goto err_put_pages;
> }
> --
> 2.36.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
next prev parent reply other threads:[~2022-08-09 16:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-30 20:00 [PATCH v7 0/2] DRM-SHMEM fixes Dmitry Osipenko
2022-06-30 20:00 ` [PATCH v7 1/2] drm/shmem-helper: Add missing vunmap on error Dmitry Osipenko
2022-08-09 16:38 ` Daniel Vetter [this message]
2022-06-30 20:00 ` [PATCH v7 2/2] drm/shmem-helper: Correct doc-comment of drm_gem_shmem_get_sg_table() Dmitry Osipenko
2022-08-09 16:36 ` Daniel Vetter
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=YvKNeMJjOjy8B+YH@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@linux.ie \
--cc=digetx@gmail.com \
--cc=dmitry.osipenko@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=tzimmermann@suse.de \
/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®