From patchwork Thu Jan 12 15:19:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9514457 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F09E160762 for ; Fri, 13 Jan 2017 00:40:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0714C286A7 for ; Fri, 13 Jan 2017 00:40:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EFAA42870C; Fri, 13 Jan 2017 00:40:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9EAC3286A7 for ; Fri, 13 Jan 2017 00:40:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CF77D6ECF8; Fri, 13 Jan 2017 00:40:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 22BA36EB25 for ; Thu, 12 Jan 2017 15:19:36 +0000 (UTC) Received: by mail-pf0-x244.google.com with SMTP id f144so3965675pfa.2 for ; Thu, 12 Jan 2017 07:19:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=W/rcFiuO0ApSdL1JyQINaztcc44zRT8tK7b7v8I7VfM=; b=gHKys08uIlsoBLbFkv5LCR/izZy6h4fkQ4lGn/0pAtgr8x/omy4V6/+2pwiAYghzOq SZtof+eorhXzBi1rVJu2da8v2qPsc+aNx7eLfxc/rlfRj4VLx6YVytHTgj7PsyZ0+Npx 408gQT4WaL0TH4Dm2Cz7hINgpju4OSVOyzNjYJkJrszOZaOyhmayzgEFB/o9dMrsDC+a 61VsqpyJT6wO9FLp+4ehP/bCOvFBQaIQKEz/p8GBKK/zNVBv8BkjysWM23V/5AlTjhpE qXQBlzidTLCHM/rRwtYf6vWxSHvMmlLx6rUoYTERrNGPycZ9sbbDn4h48jodz6PJVEvk yutA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=W/rcFiuO0ApSdL1JyQINaztcc44zRT8tK7b7v8I7VfM=; b=AL1K/NeFfSC5cOwTD2aVKBP/abFQSkt0mxNYSx5otXcjr750PTCCtXwJB34vpHl/x4 Hg9mu6FuNPbY7YJ28EMM9jdtyN119ih6l/4YUPkjcX2RY2sS7ifGGwgCpjONUOUiuKIk Zlq88L6qVp95imQBmYoHH9eFvhEwwKmrC4Slr7hsUVTjG02yyA5K61pYBTLd1fLM9k3y lP1UmuiejkwLC/3rzZGF83yyRcfhMi4lqTM+6oItTn6aEFS7/FmfMneBbDNuj8OfZ/9z Cb09wtESmlZC7kHeWkgilKIFEpokWaZ0k7fsOdocp8S4Tb9uVygjHXpvtx44HFxCMyid BIjw== X-Gm-Message-State: AIkVDXIefboODZT6P93e67YqvjMr/DppxQDgWm5pOKL/N/Wht2a0AsasB3f6HJphQzO3TQ== X-Received: by 10.98.86.68 with SMTP id k65mr17079247pfb.13.1484234375770; Thu, 12 Jan 2017 07:19:35 -0800 (PST) Received: from 192.168.0.37 (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id d15sm22529288pfl.46.2017.01.12.07.19.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jan 2017 07:19:35 -0800 (PST) From: Wei Yongjun To: Rongrong Zou , Xinwei Kong , Chen Feng , David Airlie Subject: [PATCH -next] drm/hisilicon/hibmc: Fix wrong pointer passed to PTR_ERR() Date: Thu, 12 Jan 2017 15:19:21 +0000 Message-Id: <20170112151921.16538-1-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 13 Jan 2017 00:40:31 +0000 Cc: Wei Yongjun , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun PTR_ERR should access the value just tested by IS_ERR, otherwise the wrong error code will be returned. Fixes: d1667b86795a ("drm/hisilicon/hibmc: Add support for frame buffer") Signed-off-by: Wei Yongjun Reviewed-by: Gustavo Padovan --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c index 7a6957a..16fe790 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c @@ -121,7 +121,7 @@ static int hibmc_drm_fb_create(struct drm_fb_helper *helper, hi_fbdev->fb = hibmc_framebuffer_init(priv->dev, &mode_cmd, gobj); if (IS_ERR(hi_fbdev->fb)) { - ret = PTR_ERR(info); + ret = PTR_ERR(hi_fbdev->fb); DRM_ERROR("failed to initialize framebuffer: %d\n", ret); goto out_release_fbi; }