diff options
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_cs.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 9b4124ee17f7..d9d9f5a59c42 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c | |||
@@ -243,20 +243,11 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data) | |||
243 | if ((p->cs_flags & RADEON_CS_USE_VM) && | 243 | if ((p->cs_flags & RADEON_CS_USE_VM) && |
244 | !p->rdev->vm_manager.enabled) { | 244 | !p->rdev->vm_manager.enabled) { |
245 | DRM_ERROR("VM not active on asic!\n"); | 245 | DRM_ERROR("VM not active on asic!\n"); |
246 | if (p->chunk_relocs_idx != -1) | ||
247 | kfree(p->chunks[p->chunk_relocs_idx].kdata); | ||
248 | if (p->chunk_flags_idx != -1) | ||
249 | kfree(p->chunks[p->chunk_flags_idx].kdata); | ||
250 | return -EINVAL; | 246 | return -EINVAL; |
251 | } | 247 | } |
252 | 248 | ||
253 | if (radeon_cs_get_ring(p, ring, priority)) { | 249 | if (radeon_cs_get_ring(p, ring, priority)) |
254 | if (p->chunk_relocs_idx != -1) | ||
255 | kfree(p->chunks[p->chunk_relocs_idx].kdata); | ||
256 | if (p->chunk_flags_idx != -1) | ||
257 | kfree(p->chunks[p->chunk_flags_idx].kdata); | ||
258 | return -EINVAL; | 250 | return -EINVAL; |
259 | } | ||
260 | 251 | ||
261 | 252 | ||
262 | /* deal with non-vm */ | 253 | /* deal with non-vm */ |
@@ -271,11 +262,8 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data) | |||
271 | p->chunks[p->chunk_ib_idx].kpage[0] = kmalloc(PAGE_SIZE, GFP_KERNEL); | 262 | p->chunks[p->chunk_ib_idx].kpage[0] = kmalloc(PAGE_SIZE, GFP_KERNEL); |
272 | p->chunks[p->chunk_ib_idx].kpage[1] = kmalloc(PAGE_SIZE, GFP_KERNEL); | 263 | p->chunks[p->chunk_ib_idx].kpage[1] = kmalloc(PAGE_SIZE, GFP_KERNEL); |
273 | if (p->chunks[p->chunk_ib_idx].kpage[0] == NULL || | 264 | if (p->chunks[p->chunk_ib_idx].kpage[0] == NULL || |
274 | p->chunks[p->chunk_ib_idx].kpage[1] == NULL) { | 265 | p->chunks[p->chunk_ib_idx].kpage[1] == NULL) |
275 | kfree(p->chunks[p->chunk_ib_idx].kpage[0]); | ||
276 | kfree(p->chunks[p->chunk_ib_idx].kpage[1]); | ||
277 | return -ENOMEM; | 266 | return -ENOMEM; |
278 | } | ||
279 | p->chunks[p->chunk_ib_idx].kpage_idx[0] = -1; | 267 | p->chunks[p->chunk_ib_idx].kpage_idx[0] = -1; |
280 | p->chunks[p->chunk_ib_idx].kpage_idx[1] = -1; | 268 | p->chunks[p->chunk_ib_idx].kpage_idx[1] = -1; |
281 | p->chunks[p->chunk_ib_idx].last_copied_page = -1; | 269 | p->chunks[p->chunk_ib_idx].last_copied_page = -1; |