diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/r600_cs.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r600_cs.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index 01a3ec83f284..5dceea6f71ae 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c | |||
@@ -887,7 +887,7 @@ int r600_cs_common_vline_parse(struct radeon_cs_parser *p, | |||
887 | obj = drm_mode_object_find(p->rdev->ddev, crtc_id, DRM_MODE_OBJECT_CRTC); | 887 | obj = drm_mode_object_find(p->rdev->ddev, crtc_id, DRM_MODE_OBJECT_CRTC); |
888 | if (!obj) { | 888 | if (!obj) { |
889 | DRM_ERROR("cannot find crtc %d\n", crtc_id); | 889 | DRM_ERROR("cannot find crtc %d\n", crtc_id); |
890 | return -EINVAL; | 890 | return -ENOENT; |
891 | } | 891 | } |
892 | crtc = obj_to_crtc(obj); | 892 | crtc = obj_to_crtc(obj); |
893 | radeon_crtc = to_radeon_crtc(crtc); | 893 | radeon_crtc = to_radeon_crtc(crtc); |
@@ -2328,13 +2328,8 @@ static void r600_cs_parser_fini(struct radeon_cs_parser *parser, int error) | |||
2328 | unsigned i; | 2328 | unsigned i; |
2329 | 2329 | ||
2330 | kfree(parser->relocs); | 2330 | kfree(parser->relocs); |
2331 | for (i = 0; i < parser->nchunks; i++) { | 2331 | for (i = 0; i < parser->nchunks; i++) |
2332 | kfree(parser->chunks[i].kdata); | 2332 | drm_free_large(parser->chunks[i].kdata); |
2333 | if (parser->rdev && (parser->rdev->flags & RADEON_IS_AGP)) { | ||
2334 | kfree(parser->chunks[i].kpage[0]); | ||
2335 | kfree(parser->chunks[i].kpage[1]); | ||
2336 | } | ||
2337 | } | ||
2338 | kfree(parser->chunks); | 2333 | kfree(parser->chunks); |
2339 | kfree(parser->chunks_array); | 2334 | kfree(parser->chunks_array); |
2340 | } | 2335 | } |
@@ -2391,13 +2386,12 @@ int r600_cs_legacy(struct drm_device *dev, void *data, struct drm_file *filp, | |||
2391 | ib_chunk = &parser.chunks[parser.chunk_ib_idx]; | 2386 | ib_chunk = &parser.chunks[parser.chunk_ib_idx]; |
2392 | parser.ib.length_dw = ib_chunk->length_dw; | 2387 | parser.ib.length_dw = ib_chunk->length_dw; |
2393 | *l = parser.ib.length_dw; | 2388 | *l = parser.ib.length_dw; |
2394 | r = r600_cs_parse(&parser); | 2389 | if (DRM_COPY_FROM_USER(ib, ib_chunk->user_ptr, ib_chunk->length_dw * 4)) { |
2395 | if (r) { | 2390 | r = -EFAULT; |
2396 | DRM_ERROR("Invalid command stream !\n"); | ||
2397 | r600_cs_parser_fini(&parser, r); | 2391 | r600_cs_parser_fini(&parser, r); |
2398 | return r; | 2392 | return r; |
2399 | } | 2393 | } |
2400 | r = radeon_cs_finish_pages(&parser); | 2394 | r = r600_cs_parse(&parser); |
2401 | if (r) { | 2395 | if (r) { |
2402 | DRM_ERROR("Invalid command stream !\n"); | 2396 | DRM_ERROR("Invalid command stream !\n"); |
2403 | r600_cs_parser_fini(&parser, r); | 2397 | r600_cs_parser_fini(&parser, r); |