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]
Date:   Fri, 3 Dec 2021 22:56:02 +0300
From:   Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To:     Ameer Hamza <amhamza.mgc@...il.com>, robdclark@...il.com,
        sean@...rly.run, quic_abhinavk@...cinc.com, airlied@...ux.ie,
        daniel@...ll.ch
Cc:     linux-arm-msm@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        freedreno@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] drm/msm/dpu: removed logically dead code

On 03/12/2021 22:32, Ameer Hamza wrote:
> Fixed coverity warning by removing the dead code
> 
> Addresses-Coverity: 1494147 ("Logically dead code")
> 
> Signed-off-by: Ameer Hamza <amhamza.mgc@...il.com>

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

> 
> ---
> Changes in v2:
> removed the 'fail' part completely by moving DPU_ERROR and return statement in place of corresponding goto statements.
> ---
>   .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c    | 17 +++++------------
>   1 file changed, 5 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> index 185379b18572..ddd9d89cd456 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> @@ -698,17 +698,17 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init(
>   {
>   	struct dpu_encoder_phys *phys_enc = NULL;
>   	struct dpu_encoder_irq *irq;
> -	int i, ret = 0;
> +	int i;
>   
>   	if (!p) {
> -		ret = -EINVAL;
> -		goto fail;
> +		DPU_ERROR("failed to create encoder due to invalid parameter\n");
> +		return ERR_PTR(-EINVAL);
>   	}
>   
>   	phys_enc = kzalloc(sizeof(*phys_enc), GFP_KERNEL);
>   	if (!phys_enc) {
> -		ret = -ENOMEM;
> -		goto fail;
> +		DPU_ERROR("failed to create encoder due to memory allocation error\n");
> +		return ERR_PTR(-ENOMEM);
>   	}
>   
>   	phys_enc->hw_mdptop = p->dpu_kms->hw_mdp;
> @@ -748,11 +748,4 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init(
>   	DPU_DEBUG_VIDENC(phys_enc, "created intf idx:%d\n", p->intf_idx);
>   
>   	return phys_enc;
> -
> -fail:
> -	DPU_ERROR("failed to create encoder\n");
> -	if (phys_enc)
> -		dpu_encoder_phys_vid_destroy(phys_enc);
> -
> -	return ERR_PTR(ret);
>   }
> 


-- 
With best wishes
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ