lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c19cb5e0-2ca3-0453-3c8f-e01f30748031@linaro.org>
Date:   Sat, 15 May 2021 20:45:16 +0300
From:   Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To:     Zhen Lei <thunder.leizhen@...wei.com>,
        Rob Clark <robdclark@...il.com>, Sean Paul <sean@...rly.run>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Anton Ivanov <anton.ivanov@...bridgegreys.com>,
        linux-arm-msm <linux-arm-msm@...r.kernel.org>,
        dri-devel <dri-devel@...ts.freedesktop.org>,
        freedreno <freedreno@...ts.freedesktop.org>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/1] drm/msm/dpu: Fix error return code in
 dpu_mdss_init()

On 10/05/2021 06:16, Zhen Lei wrote:
> 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 <hulkci@...wei.com>
> Signed-off-by: Zhen Lei <thunder.leizhen@...wei.com>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>

> ---
>   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);
> 


-- 
With best wishes
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ