Skip to content

Commit 0f04d05

Browse files
Colin Ian Kingdavem330
authored andcommitted
net: sched: cls_u32: use bitwise & rather than logical && on n->flags
Currently n->flags is being operated on by a logical && operator rather than a bitwise & operator. This looks incorrect as these should be bit flag operations. Fix this. Detected by CoverityScan, CID#1460398 ("Logical vs. bitwise operator") Fixes: 245dc51 ("net: sched: cls_u32: call block callbacks for offload") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 991a26a commit 0f04d05

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sched/cls_u32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ static int u32_replace_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
572572
n->flags |= TCA_CLS_FLAGS_IN_HW;
573573
}
574574

575-
if (skip_sw && !(n->flags && TCA_CLS_FLAGS_IN_HW))
575+
if (skip_sw && !(n->flags & TCA_CLS_FLAGS_IN_HW))
576576
return -EINVAL;
577577

578578
return 0;

0 commit comments

Comments
 (0)