File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -178,17 +178,26 @@ static void *tegra_bo_mmap(struct host1x_bo *bo)
178
178
{
179
179
struct tegra_bo * obj = host1x_to_tegra_bo (bo );
180
180
struct iosys_map map = { 0 };
181
+ void * vaddr ;
181
182
int ret ;
182
183
183
184
if (obj -> vaddr )
184
185
return obj -> vaddr ;
185
186
186
187
if (obj -> gem .import_attach ) {
187
188
ret = dma_buf_vmap_unlocked (obj -> gem .import_attach -> dmabuf , & map );
188
- return ret ? NULL : map .vaddr ;
189
+ if (ret < 0 )
190
+ return ERR_PTR (ret );
191
+
192
+ return map .vaddr ;
189
193
}
190
194
191
- return vmap (obj -> pages , obj -> num_pages , VM_MAP , pgprot_writecombine (PAGE_KERNEL ));
195
+ vaddr = vmap (obj -> pages , obj -> num_pages , VM_MAP ,
196
+ pgprot_writecombine (PAGE_KERNEL ));
197
+ if (!vaddr )
198
+ return ERR_PTR (- ENOMEM );
199
+
200
+ return vaddr ;
192
201
}
193
202
194
203
static void tegra_bo_munmap (struct host1x_bo * bo , void * addr )
You can’t perform that action at this time.
0 commit comments