Skip to content

Commit

Permalink
drm/exynos: fix return value check in lowlevel_buffer_allocate()
Browse files Browse the repository at this point in the history
In case of error, the function drm_prime_pages_to_sg() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
  • Loading branch information
Wei Yongjun authored and Inki Dae committed Sep 16, 2013
1 parent fafb383 commit 662bb69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/exynos/exynos_drm_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ static int lowlevel_buffer_allocate(struct drm_device *dev,
}

buf->sgt = drm_prime_pages_to_sg(buf->pages, nr_pages);
if (!buf->sgt) {
if (IS_ERR(buf->sgt)) {
DRM_ERROR("failed to get sg table.\n");
ret = -ENOMEM;
ret = PTR_ERR(buf->sgt);
goto err_free_attrs;
}

Expand Down

0 comments on commit 662bb69

Please sign in to comment.