]> git.baikalelectronics.ru Git - kernel.git/commit
drm/etnaviv: fix reference leak when mmaping imported buffer
authorLucas Stach <l.stach@pengutronix.de>
Fri, 24 Feb 2023 17:21:54 +0000 (18:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Apr 2023 09:16:45 +0000 (11:16 +0200)
commit09f6c6a0a6ebcf6e2af6eb5b5ba36fdc89be061c
treee2ff4c39663ce2420b741f0d8ecab17c73584561
parent6678da876ba15bf8d2b4b8c96c91115c1aaa106d
drm/etnaviv: fix reference leak when mmaping imported buffer

commit 963b2e8c428f79489ceeb058e8314554ec9cbe6f upstream.

drm_gem_prime_mmap() takes a reference on the GEM object, but before that
drm_gem_mmap_obj() already takes a reference, which will be leaked as only
one reference is dropped when the mapping is closed. Drop the extra
reference when dma_buf_mmap() succeeds.

Cc: stable@vger.kernel.org
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c