Commit 163f2597 authored by Lukas Wunner's avatar Lukas Wunner Committed by Kamal Mostafa

drm: Fix return value of drm_framebuffer_init()

commit 3c67d839 upstream.

In its original version, drm_framebuffer_init() returned a negative int
if drm_mode_object_get() failed (f453ba04, "DRM: add mode setting
support").

This was accidentally disabled by commit 4b096ac1 ("drm: revamp
locking around fb creation/destruction"). Thus, drm_framebuffer_init()
pretends success if drm_mode_object_get() failed.

Reinstate the original behaviour. Also fix erroneous kernel-doc of
drm_mode_object_get().

Fixes: 4b096ac1 ("drm: revamp locking around fb creation/
    destruction")
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent ecaf4119
...@@ -296,8 +296,7 @@ EXPORT_SYMBOL(drm_get_format_name); ...@@ -296,8 +296,7 @@ EXPORT_SYMBOL(drm_get_format_name);
* for tracking modes, CRTCs and connectors. * for tracking modes, CRTCs and connectors.
* *
* RETURNS: * RETURNS:
* New unique (relative to other objects in @dev) integer identifier for the * Zero on success, error code on failure.
* object.
*/ */
static int drm_mode_object_get(struct drm_device *dev, static int drm_mode_object_get(struct drm_device *dev,
struct drm_mode_object *obj, uint32_t obj_type) struct drm_mode_object *obj, uint32_t obj_type)
...@@ -403,7 +402,7 @@ int drm_framebuffer_init(struct drm_device *dev, struct drm_framebuffer *fb, ...@@ -403,7 +402,7 @@ int drm_framebuffer_init(struct drm_device *dev, struct drm_framebuffer *fb,
out: out:
mutex_unlock(&dev->mode_config.fb_lock); mutex_unlock(&dev->mode_config.fb_lock);
return 0; return ret;
} }
EXPORT_SYMBOL(drm_framebuffer_init); EXPORT_SYMBOL(drm_framebuffer_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment