mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-29 22:06:39 +07:00
vmwgfx: Allow reference and unreference of NULL fence objects.
The execbuf utils may call reference on NULL fence objects. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
b37a6b9ad0
commit
e93daed8e2
@ -177,6 +177,9 @@ static int vmw_fence_obj_init(struct vmw_fence_manager *fman,
|
||||
|
||||
struct vmw_fence_obj *vmw_fence_obj_reference(struct vmw_fence_obj *fence)
|
||||
{
|
||||
if (unlikely(fence == NULL))
|
||||
return NULL;
|
||||
|
||||
kref_get(&fence->kref);
|
||||
return fence;
|
||||
}
|
||||
@ -191,8 +194,12 @@ struct vmw_fence_obj *vmw_fence_obj_reference(struct vmw_fence_obj *fence)
|
||||
void vmw_fence_obj_unreference(struct vmw_fence_obj **fence_p)
|
||||
{
|
||||
struct vmw_fence_obj *fence = *fence_p;
|
||||
struct vmw_fence_manager *fman = fence->fman;
|
||||
struct vmw_fence_manager *fman;
|
||||
|
||||
if (unlikely(fence == NULL))
|
||||
return;
|
||||
|
||||
fman = fence->fman;
|
||||
*fence_p = NULL;
|
||||
spin_lock_irq(&fman->lock);
|
||||
BUG_ON(atomic_read(&fence->kref.refcount) == 0);
|
||||
|
Loading…
Reference in New Issue
Block a user