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)
801801 if (atomic_read (& bo_gem -> ref_count ) <= 0 )
802802 return ;
803803
804- if (atomic_dec_and_test (& bo_gem -> ref_count ))
804+ if (atomic_add_unless (& bo_gem -> ref_count , -1 , 1 ))
805805 {
806806 /* release memory associated with this object */
807807 /* Clear any left-over mappings */
@@ -811,9 +811,9 @@ drm_export void mos_bo_unreference_xe(struct mos_linux_bo *bo)
811811 __mos_bo_mark_mmaps_incoherent_xe (bo );
812812 }
813813
814- DRMLISTDEL (& bo_gem -> name_list );
815814
816- mos_bo_free_xe (bo );
815+ if (atomic_dec_and_test (& bo_gem -> ref_count ))
816+ mos_bo_free_xe (bo );
817817 }
818818}
819819
@@ -3003,6 +3003,7 @@ mos_bo_free_xe(struct mos_linux_bo *bo)
30033003 mos_gem_bo_wait_rendering_xe (bo );
30043004
30053005 bufmgr_gem -> m_lock .lock ();
3006+ DRMLISTDEL (& bo_gem -> name_list );
30063007
30073008 if (!bo_gem -> is_userptr )
30083009 {
You can’t perform that action at this time.
0 commit comments