summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-09-11 00:56:12 +0200
committerRob Clark <robdclark@gmail.com>2013-09-11 23:31:33 +0200
commit1f70e079c773b2c5988b0f0b4d314fc0f6c7a1b8 (patch)
tree5fa117c3854eeeeb23d749402e125312e67cf7c3 /drivers/gpu
parentdrm/msm: fix cmdstream size check (diff)
downloadlinux-1f70e079c773b2c5988b0f0b4d314fc0f6c7a1b8.tar.xz
linux-1f70e079c773b2c5988b0f0b4d314fc0f6c7a1b8.zip
drm/msm: fix return value check in ERR_PTR()
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/msm/msm_gem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
index df0390f5ec58..5999b67ec8f1 100644
--- a/drivers/gpu/drm/msm/msm_gem.c
+++ b/drivers/gpu/drm/msm/msm_gem.c
@@ -40,9 +40,9 @@ static struct page **get_pages(struct drm_gem_object *obj)
}
msm_obj->sgt = drm_prime_pages_to_sg(p, npages);
- if (!msm_obj->sgt) {
+ if (IS_ERR(msm_obj->sgt)) {
dev_err(dev->dev, "failed to allocate sgt\n");
- return ERR_PTR(-ENOMEM);
+ return ERR_CAST(msm_obj->sgt);
}
msm_obj->pages = p;