Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2331200pxj; Sun, 9 May 2021 23:40:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6QRjqZdQZ7IvH7Cy8O5YCM4Njmp7m0MGuD7TquhZ6Cv417rhSMVFhAQbuAu8OXVBO6i3F X-Received: by 2002:a05:6e02:1a49:: with SMTP id u9mr21748929ilv.306.1620628841491; Sun, 09 May 2021 23:40:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620628841; cv=none; d=google.com; s=arc-20160816; b=gEnsLfaSN61riVh3r8uno4li4rrhmu8zbO6oPqimMIaAuYJzN9K6UlyMTLVdLUOMgF 0Mr+bYoU8Yx/cyevFGG2xQNifI264uYtrXvgwW3gi7daRsRgUrnJwpMOEI0Mu5YKm4/p lj5/54X38vslHMIKVkmpNj/lVURBs/7InzZEMGhgjtOq5ViXDASwRufmrA8a42cL4Dhn qhOEqn49H5PyRcRCc/TPTJzaHoOiy4qixCLxLdi/fP5NiUYx/LOe1oazL0Zak1ln9TDS Lxn27wp4G0gdXbi4jtLvnxkBukHElJUfhpNnntw7GLcRQN8SiI+0fXtjtTZeMLSsU273 aRQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Dh7ccx3l7zhH3OHkNDvhHQT8sz2cpNNFXWdiKjKnWbI=; b=Esv2XbfJvQL6d6wWc+gYgo9fcmLQ30cLu9HE/O5cBlH/W9VfdSY+mwKtMV2m3lilIM ZkX+tzChtjwctHFZml4x/Qj0JHjMTmqGE1J9f6pNNciX1WJM523Y/W35qXG5wpS5Fwc5 OuAlEY+TL77WC0eeEGN/SekfAcF6XDg8IhV+9V7UBJJgzEN0P2dA8YwAvALw9X4fKthj XdTBBSG2HtxUdZWBs7sY/Dg6GK+lXnQmlML0RiBa6NHw/20kl3SdTZz5okjSFY+ImDRd oblODF6mKYaNrpFYu+1n/ayS9unKZhMlOF2M9Z5uslLQn81aZr45JOdeFC1HKzvlcTve fsUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w9si17831584jad.47.2021.05.09.23.40.29; Sun, 09 May 2021 23:40:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229863AbhEJGjl (ORCPT + 99 others); Mon, 10 May 2021 02:39:41 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2546 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230155AbhEJGjk (ORCPT ); Mon, 10 May 2021 02:39:40 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Fdrsl4mztzkYNj; Mon, 10 May 2021 14:35:55 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.177.72) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Mon, 10 May 2021 14:38:23 +0800 From: Zhen Lei To: Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Stephen Boyd , linux-arm-msm , dri-devel , freedreno , linux-kernel CC: Zhen Lei Subject: [PATCH v2 1/1] drm/msm/dpu: Fix error return code in dpu_mdss_init() Date: Mon, 10 May 2021 14:38:05 +0800 Message-ID: <20210510063805.3262-2-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20210510063805.3262-1-thunder.leizhen@huawei.com> References: <20210510063805.3262-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.177.72] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The error code returned by platform_get_irq() is stored in 'irq', it's forgotten to be copied to 'ret' before being returned. As a result, the value 0 of 'ret' is returned incorrectly. After the above fix is completed, initializing the local variable 'ret' to 0 is no longer needed, remove it. In addition, when dpu_mdss_init() is successfully returned, the value of 'ret' is always 0. Therefore, replace "return ret" with "return 0" to make the code clearer. Fixes: 070e64dc1bbc ("drm/msm/dpu: Convert to a chained irq chip") Reported-by: Hulk Robot Signed-off-by: Zhen Lei --- drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c index 06b56fec04e047a..6b0a7bc87eb75b8 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c @@ -225,7 +225,7 @@ int dpu_mdss_init(struct drm_device *dev) struct msm_drm_private *priv = dev->dev_private; struct dpu_mdss *dpu_mdss; struct dss_module_power *mp; - int ret = 0; + int ret; int irq; dpu_mdss = devm_kzalloc(dev->dev, sizeof(*dpu_mdss), GFP_KERNEL); @@ -253,8 +253,10 @@ int dpu_mdss_init(struct drm_device *dev) goto irq_domain_error; irq = platform_get_irq(pdev, 0); - if (irq < 0) + if (irq < 0) { + ret = irq; goto irq_error; + } irq_set_chained_handler_and_data(irq, dpu_mdss_irq, dpu_mdss); @@ -263,7 +265,7 @@ int dpu_mdss_init(struct drm_device *dev) pm_runtime_enable(dev->dev); - return ret; + return 0; irq_error: _dpu_mdss_irq_domain_fini(dpu_mdss); -- 2.26.0.106.g9fadedd