aboutsummaryrefslogtreecommitdiff
path: root/net/sched/act_pedit.c
diff options
context:
space:
mode:
authorGravatar Roman Mashak <mrv@mojatatu.com> 2018-06-27 13:33:33 -0400
committerGravatar David S. Miller <davem@davemloft.net> 2018-06-28 22:12:03 +0900
commit6ff7586e382cb4274adefd56501d428ea39a5af3 (patch)
treec4877d6372969434de29ea938a1eaeae68f74099 /net/sched/act_pedit.c
parentnet sched actions: fix sparse warning (diff)
downloadlinux-6ff7586e382cb4274adefd56501d428ea39a5af3.tar.gz
linux-6ff7586e382cb4274adefd56501d428ea39a5af3.tar.bz2
linux-6ff7586e382cb4274adefd56501d428ea39a5af3.zip
net sched actions: use sizeof operator for buffer length
Replace constant integer with sizeof() to clearly indicate the destination buffer length in skb_header_pointer() calls. Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Roman Mashak <mrv@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/act_pedit.c')
-rw-r--r--net/sched/act_pedit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index 9c2d8a31a5c5..3b775f54cee5 100644
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -319,7 +319,7 @@ static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a,
goto bad;
}
d = skb_header_pointer(skb, hoffset + tkey->at,
- 1, &_d);
+ sizeof(_d), &_d);
if (!d)
goto bad;
offset += (*d & tkey->offmask) >> tkey->shift;
@@ -337,7 +337,7 @@ static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a,
}
ptr = skb_header_pointer(skb, hoffset + offset,
- 4, &hdata);
+ sizeof(hdata), &hdata);
if (!ptr)
goto bad;
/* just do it, baby */