Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755102AbbLIJwk (ORCPT ); Wed, 9 Dec 2015 04:52:40 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:45477 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754821AbbLIJl2 (ORCPT ); Wed, 9 Dec 2015 04:41:28 -0500 From: Luis Henriques To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Daniel Vetter , Lukas Wunner , Luis Henriques Subject: [PATCH 3.16.y-ckt 100/126] drm: Fix return value of drm_framebuffer_init() Date: Wed, 9 Dec 2015 09:37:50 +0000 Message-Id: <1449653896-5236-101-git-send-email-luis.henriques@canonical.com> In-Reply-To: <1449653896-5236-1-git-send-email-luis.henriques@canonical.com> References: <1449653896-5236-1-git-send-email-luis.henriques@canonical.com> X-Extended-Stable: 3.16 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2022 Lines: 57 3.16.7-ckt21 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Lukas Wunner commit 3c67d839b30c7d6d6ab5c6fddac0f58ec8095d50 upstream. In its original version, drm_framebuffer_init() returned a negative int if drm_mode_object_get() failed (f453ba046074, "DRM: add mode setting support"). This was accidentally disabled by commit 4b096ac10da0 ("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: 4b096ac10da0 ("drm: revamp locking around fb creation/ destruction") Cc: Daniel Vetter Signed-off-by: Lukas Wunner Signed-off-by: Daniel Vetter Signed-off-by: Luis Henriques --- drivers/gpu/drm/drm_crtc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index ee96912e0824..0dd2c26c55ab 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -369,8 +369,7 @@ EXPORT_SYMBOL(drm_get_format_name); * reference counted modeset objects like framebuffers. * * Returns: - * New unique (relative to other objects in @dev) integer identifier for the - * object. + * Zero on success, error code on failure. */ int drm_mode_object_get(struct drm_device *dev, struct drm_mode_object *obj, uint32_t obj_type) @@ -492,7 +491,7 @@ int drm_framebuffer_init(struct drm_device *dev, struct drm_framebuffer *fb, out: mutex_unlock(&dev->mode_config.fb_lock); - return 0; + return ret; } EXPORT_SYMBOL(drm_framebuffer_init); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/