i915_gem_vma_create() returns and ERR_PTR() or a valid pointer, it never
returns NULL.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
i915_gem_object_pin_pages(obj);
vma = i915_gem_vma_create(obj, &dev_priv->gtt.base);
- if (vma == NULL) {
+ if (IS_ERR(vma)) {
i915_gem_object_unpin_pages(obj);
- return -ENOMEM;
+ return PTR_ERR(vma);
}
search_free:
return obj;
vma = i915_gem_vma_create(obj, &dev_priv->gtt.base);
- if (!vma) {
- ret = -ENOMEM;
+ if (IS_ERR(vma)) {
+ ret = PTR_ERR(vma);
goto err_out;
}