From patchwork Tue May 7 13:24:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2537581 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 613FFDF2E5 for ; Wed, 8 May 2013 05:34:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E84DE5FD9 for ; Tue, 7 May 2013 22:34:20 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-bk0-f49.google.com (mail-bk0-f49.google.com [209.85.214.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 02ECAE5D37 for ; Tue, 7 May 2013 06:24:32 -0700 (PDT) Received: by mail-bk0-f49.google.com with SMTP id e19so292132bku.8 for ; Tue, 07 May 2013 06:24:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to:cc :content-type; bh=2mo3xIhrzZlyRhEGFieTa7xluYmqxyBOwdmrHVpRuOA=; b=YdC2y4wbXGOoofVhfK8TtWeacZJeiMN2P8iF/IwmvwLGMNg5KBrmuMIIxftHy7ja2r 6BYSgZ+Ue4VklzVDO+WXREdV4VV71nOjjm87VBE8j3pzPOpwbwBxbq9WPHqnlfLv5Mmc Pvxt8gvxqy5wmuT4t/cuOxYxKzw/a8bZXbMxIk3ZPcvdGCJb6JZx2gbUe/O33SNnGI2V AwF3rPPBX8Rv4nF6ckHEQd8tOfzDMOzs8lZq06GjOgI8uaXoTI16nePrHHv3IdDTWEcT bvTfzjPzYzFmkMZgrhprz7FQ91O8YJ7N1FMK65Yq7bSLBfVenQ1FRbIuSqgbQKQLJ3RN jltQ== MIME-Version: 1.0 X-Received: by 10.204.62.137 with SMTP id x9mr581724bkh.90.1367933070221; Tue, 07 May 2013 06:24:30 -0700 (PDT) Received: by 10.204.199.129 with HTTP; Tue, 7 May 2013 06:24:30 -0700 (PDT) Date: Tue, 7 May 2013 21:24:30 +0800 Message-ID: Subject: [PATCH] drm/exynos: fix error return code in exynos_drm_ipp_set_property() From: Wei Yongjun To: inki.dae@samsung.com, jy0922.shim@samsung.com, sw0312.kim@samsung.com, kyungmin.park@samsung.com, airlied@linux.ie X-Mailman-Approved-At: Tue, 07 May 2013 22:34:04 -0700 Cc: yongjun_wei@trendmicro.com.cn, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Wei Yongjun Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. ipp_create_cmd_work() return ERR_PTR() on error and never return NULL, so use IS_ERR() instead of IS_ERR_OR_NULL(). Signed-off-by: Wei Yongjun --- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 29d2ad3..b0d6431 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -521,20 +521,23 @@ int exynos_drm_ipp_set_property(struct drm_device *drm_dev, void *data, c_node->state = IPP_STATE_IDLE; c_node->start_work = ipp_create_cmd_work(); - if (IS_ERR_OR_NULL(c_node->start_work)) { + if (IS_ERR(c_node->start_work)) { DRM_ERROR("failed to create start work.\n"); + ret = PTR_ERR(c_node->start_work); goto err_clear; } c_node->stop_work = ipp_create_cmd_work(); - if (IS_ERR_OR_NULL(c_node->stop_work)) { + if (IS_ERR(c_node->stop_work)) { DRM_ERROR("failed to create stop work.\n"); + ret = PTR_ERR(c_node->stop_work); goto err_free_start; } c_node->event_work = ipp_create_event_work(); - if (IS_ERR_OR_NULL(c_node->event_work)) { + if (IS_ERR(c_node->event_work)) { DRM_ERROR("failed to create event work.\n"); + ret = PTR_ERR(c_node->event_work); goto err_free_stop; }