summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/myricom
diff options
context:
space:
mode:
authorNirmoy Das <nirmoy.das@intel.com>2023-01-17 20:52:36 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-01 10:34:42 +0300
commit0bdc4b4ba7206c452ee81c82fa66e39d0e1780fb (patch)
treea6e7fdc4c8d29b86ce0555eadab7c7447f0b184e /drivers/net/ethernet/myricom
parent67444f8ca31cdaf45e0b761241ad49b1ae04bcf9 (diff)
downloadlinux-0bdc4b4ba7206c452ee81c82fa66e39d0e1780fb.tar.xz
drm/i915: Fix a memory leak with reused mmap_offset
[ Upstream commit 0220e4fe178c3390eb0291cdb34912d66972db8a ] drm_vma_node_allow() and drm_vma_node_revoke() should be called in balanced pairs. We call drm_vma_node_allow() once per-file everytime a user calls mmap_offset, but only call drm_vma_node_revoke once per-file on each mmap_offset. As the mmap_offset is reused by the client, the per-file vm_count may remain non-zero and the rbtree leaked. Call drm_vma_node_allow_once() instead to prevent that memory leak. Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Cc: Andi Shyti <andi.shyti@linux.intel.com> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com> Fixes: 786555987207 ("drm/i915/gem: Store mmap_offsets in an rbtree rather than a plain list") Reported-by: Chuansheng Liu <chuansheng.liu@intel.com> Reported-by: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Link: https://lore.kernel.org/r/20230117175236.22317-2-nirmoy.das@intel.com Signed-off-by: Maxime Ripard <maxime@cerno.tech> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/myricom')
0 files changed, 0 insertions, 0 deletions