Re: [PATCH] selinux: Remove redundant assignment to rc
From: Paul Moore
Date: Mon May 10 2021 - 21:49:40 EST
On Wed, Apr 28, 2021 at 6:00 AM Jiapeng Chong
<jiapeng.chong@xxxxxxxxxxxxxxxxx> wrote:
>
> Variable rc is set to '-EINVAL' but this value is never read as
> it is overwritten or not used later on, hence it is a redundant
> assignment and can be removed.
>
> Cleans up the following clang-analyzer warning:
>
> security/selinux/ss/services.c:2103:3: warning: Value stored to 'rc' is
> never read [clang-analyzer-deadcode.DeadStores].
>
> security/selinux/ss/services.c:2079:2: warning: Value stored to 'rc' is
> never read [clang-analyzer-deadcode.DeadStores].
>
> security/selinux/ss/services.c:2071:2: warning: Value stored to 'rc' is
> never read [clang-analyzer-deadcode.DeadStores].
>
> security/selinux/ss/services.c:2062:2: warning: Value stored to 'rc' is
> never read [clang-analyzer-deadcode.DeadStores].
>
> security/selinux/ss/policydb.c:2592:3: warning: Value stored to 'rc' is
> never read [clang-analyzer-deadcode.DeadStores].
>
> Reported-by: Abaci Robot <abaci@xxxxxxxxxxxxxxxxx>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@xxxxxxxxxxxxxxxxx>
> ---
> security/selinux/ss/policydb.c | 1 -
> security/selinux/ss/services.c | 4 ----
> 2 files changed, 5 deletions(-)
Merged into selinux/next, thanks.
--
paul moore
www.paul-moore.com