Skip to content

Commit

Permalink
drm/ttm: fix unreachable code.
Browse files Browse the repository at this point in the history
None of the in-tree drivers use user objects yet so this wasn't hitting
us.

Stanse found unreachable code in ttm_bo_add_ttm:
http://decibel.fi.muni.cz/~xslaby/stanse/error.cgi?db=32&id=714#l238

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Dave Airlie committed Dec 7, 2009
1 parent ab2c067 commit 447aeb9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/gpu/drm/ttm/ttm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,10 @@ static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_alloc)
bo->ttm = ttm_tt_create(bdev, bo->num_pages << PAGE_SHIFT,
page_flags | TTM_PAGE_FLAG_USER,
glob->dummy_read_page);
if (unlikely(bo->ttm == NULL))
if (unlikely(bo->ttm == NULL)) {
ret = -ENOMEM;
break;
break;
}

ret = ttm_tt_set_user(bo->ttm, current,
bo->buffer_start, bo->num_pages);
Expand Down

0 comments on commit 447aeb9

Please sign in to comment.