Skip to content

Commit

Permalink
bpf: remove redundant assignment to err
Browse files Browse the repository at this point in the history
The variable err is assigned with the value -EINVAL that is never
read and it is re-assigned a new value later on.  The assignment is
redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
Colin Ian King authored and Daniel Borkmann committed Jun 4, 2019
1 parent 2ed9933 commit 6685699
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kernel/bpf/devmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ static u64 dev_map_bitmap_size(const union bpf_attr *attr)
static struct bpf_map *dev_map_alloc(union bpf_attr *attr)
{
struct bpf_dtab *dtab;
int err = -EINVAL;
u64 cost;
int err;

if (!capable(CAP_NET_ADMIN))
return ERR_PTR(-EPERM);
Expand Down
2 changes: 1 addition & 1 deletion kernel/bpf/xskmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ struct xsk_map {

static struct bpf_map *xsk_map_alloc(union bpf_attr *attr)
{
int cpu, err = -EINVAL;
struct xsk_map *m;
int cpu, err;
u64 cost;

if (!capable(CAP_NET_ADMIN))
Expand Down

0 comments on commit 6685699

Please sign in to comment.