]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gvt: fix dropping obj reference twice
authorPan Bian <bianpan2016@163.com>
Wed, 6 Nov 2019 07:31:07 +0000 (15:31 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Fri, 8 Nov 2019 03:04:07 +0000 (11:04 +0800)
commitb949ab9c90ee623e61cecd94ee22bef2eaf6b466
treea80848e715fb2521ce30d97e7036762d2eb65976
parentaa58619ee8ed42610bf1297ee64611e2719ccd23
drm/i915/gvt: fix dropping obj reference twice

The reference count of obj will be decremented twice if error occurs
in dma_buf_fd(). Additionally, attempting to read the reference count of
obj after dropping reference may lead to a use after free bug. Here, we
drop obj's reference until it is not used.

Fixes: 493676e3dbd2 ("drm/i915/gvt: Dmabuf support for GVT-g")
Signed-off-by: Pan Bian <bianpan2016@163.com>
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/dmabuf.c