]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
bpf: devmap: remove redundant assignment of dev = dev
authorColin Ian King <colin.king@canonical.com>
Wed, 30 May 2018 15:09:16 +0000 (16:09 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 30 May 2018 21:02:48 +0000 (14:02 -0700)
The assignment dev = dev is redundant and should be removed.

Detected by CoverityScan, CID#1469486 ("Evaluation order violation")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/devmap.c

index ae16d0c373efb0271deaa1ec8b231582d48dd9fa..1fe3fe60508aa9a7cab3ed37ae09aa23fab118a0 100644 (file)
@@ -352,7 +352,7 @@ int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp,
 static void *dev_map_lookup_elem(struct bpf_map *map, void *key)
 {
        struct bpf_dtab_netdev *obj = __dev_map_lookup_elem(map, *(u32 *)key);
-       struct net_device *dev = dev = obj ? obj->dev : NULL;
+       struct net_device *dev = obj ? obj->dev : NULL;
 
        return dev ? &dev->ifindex : NULL;
 }