File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
drivers/gpu/drm/amd/amdgpu Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -132,13 +132,25 @@ static const struct mmu_interval_notifier_ops amdgpu_mn_hsa_ops = {
132
132
*/
133
133
int amdgpu_mn_register (struct amdgpu_bo * bo , unsigned long addr )
134
134
{
135
+ int r ;
136
+
135
137
if (bo -> kfd_bo )
136
- return mmu_interval_notifier_insert (& bo -> notifier , current -> mm ,
138
+ r = mmu_interval_notifier_insert (& bo -> notifier , current -> mm ,
137
139
addr , amdgpu_bo_size (bo ),
138
140
& amdgpu_mn_hsa_ops );
139
- return mmu_interval_notifier_insert (& bo -> notifier , current -> mm , addr ,
140
- amdgpu_bo_size (bo ),
141
- & amdgpu_mn_gfx_ops );
141
+ else
142
+ r = mmu_interval_notifier_insert (& bo -> notifier , current -> mm , addr ,
143
+ amdgpu_bo_size (bo ),
144
+ & amdgpu_mn_gfx_ops );
145
+ if (r )
146
+ /*
147
+ * Make sure amdgpu_hmm_unregister() doesn't call
148
+ * mmu_interval_notifier_remove() when the notifier isn't properly
149
+ * initialized.
150
+ */
151
+ bo -> notifier .mm = NULL ;
152
+
153
+ return r ;
142
154
}
143
155
144
156
/**
You can’t perform that action at this time.
0 commit comments