drm: Propagate error code from fb_create()

Change the interface to expect a PTR_ERR specifing the real error code
as opposed to assuming a NULL return => -EINVAL. Just once the user may
not be at fault!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Chris Wilson
2010-08-08 13:36:38 +01:00
committed by Dave Airlie
parent 0d18abedfa
commit cce13ff759
6 changed files with 18 additions and 17 deletions

View File

@@ -1682,9 +1682,9 @@ int drm_mode_addfb(struct drm_device *dev,
/* TODO setup destructor callback */
fb = dev->mode_config.funcs->fb_create(dev, file_priv, r);
if (!fb) {
if (IS_ERR(fb)) {
DRM_ERROR("could not create framebuffer\n");
ret = -EINVAL;
ret = PTR_ERR(fb);
goto out;
}