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: <0dbdc879-8da7-3a08-1e42-6b8b88dfceb6@gmail.com>
Date:   Tue, 25 May 2021 16:09:12 +0200
From:   Christian König <ckoenig.leichtzumerken@...il.com>
To:     Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>,
        alexander.deucher@....com
Cc:     airlied@...ux.ie, Xinhui.Pan@....com, linux-kernel@...r.kernel.org,
        amd-gfx@...ts.freedesktop.org, sumit.semwal@...aro.org,
        linaro-mm-sig@...ts.linaro.org, dri-devel@...ts.freedesktop.org,
        daniel@...ll.ch, christian.koenig@....com,
        linux-media@...r.kernel.org
Subject: Re: [PATCH v2] amdgpu: remove unreachable code



Am 25.05.21 um 12:40 schrieb Jiapeng Chong:
> In the function amdgpu_uvd_cs_msg(), every branch in the switch
> statement will have a return, so the code below the switch statement
> will not be executed.
>
> Eliminate the follow smatch warning:
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:845 amdgpu_uvd_cs_msg() warn:
> ignoring unreachable code.
>
> Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
> ---
> Changes in v2:
>    -For the follow advice: https://lore.kernel.org/patchwork/patch/1435074/
>
>   drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> index 82f0542..b32ed85 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> @@ -840,7 +840,6 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx,
>   
>   	default:
>   		DRM_ERROR("Illegal UVD message type (%d)!\n", msg_type);
> -		return -EINVAL;
>   	}
>   	BUG();

You also need to remove the BUG() here or otherwise that will crash on 
an relatively harmless error.

Christian.

>   	return -EINVAL;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ