Skip to content

Commit

Permalink
mpls: Remove redundant assignment to err
Browse files Browse the repository at this point in the history
Variable err is set to -ENOMEM but this value is never read as it is
overwritten with a new value later on, hence it is a redundant
assignment and can be removed.

Cleans up the following clang-analyzer warning:

net/mpls/af_mpls.c:1022:2: warning: Value stored to 'err' is never read
[clang-analyzer-deadcode.DeadStores].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiapeng Chong authored and David S. Miller committed Apr 27, 2021
1 parent 2342eb1 commit ad542fb
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion net/mpls/af_mpls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,6 @@ static int mpls_route_add(struct mpls_route_config *cfg,
goto errout;
}

err = -ENOMEM;
rt = mpls_rt_alloc(nhs, max_via_alen, max_labels);
if (IS_ERR(rt)) {
err = PTR_ERR(rt);
Expand Down

0 comments on commit ad542fb

Please sign in to comment.