File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
media_softlet/linux/common/os/xe Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -801,7 +801,7 @@ drm_export void mos_bo_unreference_xe(struct mos_linux_bo *bo)
801
801
if (atomic_read (& bo_gem -> ref_count ) <= 0 )
802
802
return ;
803
803
804
- if (atomic_dec_and_test (& bo_gem -> ref_count ))
804
+ if (atomic_add_unless (& bo_gem -> ref_count , -1 , 1 ))
805
805
{
806
806
/* release memory associated with this object */
807
807
/* Clear any left-over mappings */
@@ -811,9 +811,9 @@ drm_export void mos_bo_unreference_xe(struct mos_linux_bo *bo)
811
811
__mos_bo_mark_mmaps_incoherent_xe (bo );
812
812
}
813
813
814
- DRMLISTDEL (& bo_gem -> name_list );
815
814
816
- mos_bo_free_xe (bo );
815
+ if (atomic_dec_and_test (& bo_gem -> ref_count ))
816
+ mos_bo_free_xe (bo );
817
817
}
818
818
}
819
819
@@ -3003,6 +3003,7 @@ mos_bo_free_xe(struct mos_linux_bo *bo)
3003
3003
mos_gem_bo_wait_rendering_xe (bo );
3004
3004
3005
3005
bufmgr_gem -> m_lock .lock ();
3006
+ DRMLISTDEL (& bo_gem -> name_list );
3006
3007
3007
3008
if (!bo_gem -> is_userptr )
3008
3009
{
You can’t perform that action at this time.
0 commit comments