From patchwork Mon Jul 12 06:09:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 472961 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2680760jao; Mon, 12 Jul 2021 00:20:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfGYCVTkuXjdvA/mTmp2jyJKb2vt76yfaosIDCniqHmYJk3K9/y/lUambwwyTgSMocuiTu X-Received: by 2002:a05:6402:4308:: with SMTP id m8mr64264026edc.237.1626074418516; Mon, 12 Jul 2021 00:20:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626074418; cv=none; d=google.com; s=arc-20160816; b=i/7KpO7vfrbQGE/maXbgzCm3G6+RQliTd1NegtPjHiw/oEDR6f1CcVyW8VqBI0YHdE RpJN7dBZblrPQK+VvLC3kbyp0Dk1z2xbyKCm2RhM+3HJcasEiYbLHFeB/xs7DU4YNGNq UtP/YDq0ruPMjWX3SyjIg/16NlncQ88amvV+eqCmbE9OIGMzAY8yS91wfuxovnhRbXUM WpN7K3fL6MHblv6x9gSarcBgOV/APEeogplnNJ/go+gFcDqnHHMOZUo2zH8OMnqevHEC Dr56T4lFRZ8cFOGPN6b1gPz9/srfFZUOPlot/0iVm/G3RZm09Yi1fuyUzVC7E5QYQspH zE/A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1V+LL5zt4d2bSNsd47Qa84cvOnjcv4tn4EVEG2a+StE=; b=KcuypdRsVlRdA2oBvRc5ah+Crq7hn98cDBkuS5P2TkUcV7+ioRPZXQv4rIy2MgVJ5o 3fCyEo8K68zDpQWZzFcXxnHU+8aHF+5Q1NG8dWanx5vZ0KOMvcuAlsIUsEGmJTa1Bmnf Iiy/qvUkO/PwKmecVp5J6c/4T9kq6FsR8Y7TMKiXNkYGTAYxJKZAo1zmWS+eqzsbC3y+ GJP0D5gZF3LW2k2CLbzeX87rqn43d1dDSS50LQIs+GMEa8QXavY9eC/+90FolPnkQC21 vbmEGg5OUe3F71u/OhtP+hKoEYoe0j0DqNNelANsmKSptasyo/V1ll87V+cRMtUXpHVm Ox9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SWhwrgJZ; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d9si16909677edq.169.2021.07.12.00.20.18; Mon, 12 Jul 2021 00:20:18 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SWhwrgJZ; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344939AbhGLHVn (ORCPT + 12 others); Mon, 12 Jul 2021 03:21:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:54762 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244298AbhGLHSN (ORCPT ); Mon, 12 Jul 2021 03:18:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 95BA3613C7; Mon, 12 Jul 2021 07:15:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626074125; bh=U8qX7rLZG5FeDrJEnL+vbRTenG7k4myYULFhxlSmmtc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SWhwrgJZdQP7JsIeE/YyIAKXk3HfEl1hRCRmlXl1vLGYCoDqtGqNWf8Jgf1IzmiUY K0585R7phJPRKa2j84NTu9ChYKzZxmTcvHjbBHbYExQGAkzIVll28rvNlgvuHpz+ro WG9GoBj9Dzdiapx9kaOFhYvmN6dN9uDUrehLXhi8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhen Lei , Stephen Boyd , Dmitry Baryshkov , Rob Clark , Sasha Levin Subject: [PATCH 5.12 472/700] drm/msm/dpu: Fix error return code in dpu_mdss_init() Date: Mon, 12 Jul 2021 08:09:15 +0200 Message-Id: <20210712061026.804661130@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060924.797321836@linuxfoundation.org> References: <20210712060924.797321836@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Zhen Lei [ Upstream commit e020ac961ce5d038de66dc7f6ffca98899e9a3f3 ] 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 Link: https://lore.kernel.org/r/20210510063805.3262-2-thunder.leizhen@huawei.com Reviewed-by: Stephen Boyd Reviewed-by: Dmitry Baryshkov Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 2.30.2 diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c index 3416e9617ee9..96f3908e4c5b 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c @@ -222,7 +222,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); @@ -250,8 +250,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); @@ -260,7 +262,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);