aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/em_cmp.c
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-12-01 11:31:10 +0000
committersaturneric <[email protected]>2025-12-01 11:31:10 +0000
commitfa2a26ee8b4693d3733a7d58863cb38cb0e8680e (patch)
tree01f99691b8e34c516e435932f1353ad673bedf2e /net/sched/em_cmp.c
parentfix(driver): sync specific drivers from rpi upstream (diff)
parentLinux 6.18 (diff)
downloadkernel-main.tar.gz
kernel-main.zip
Merge tag 'v6.18' into linux-6.18.yHEADmainlinux-6.18.y
Linux 6.18
Diffstat (limited to 'net/sched/em_cmp.c')
-rw-r--r--net/sched/em_cmp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sched/em_cmp.c b/net/sched/em_cmp.c
index 64b637f18bc7..48c1bce74f49 100644
--- a/net/sched/em_cmp.c
+++ b/net/sched/em_cmp.c
@@ -22,9 +22,12 @@ static int em_cmp_match(struct sk_buff *skb, struct tcf_ematch *em,
struct tcf_pkt_info *info)
{
struct tcf_em_cmp *cmp = (struct tcf_em_cmp *) em->data;
- unsigned char *ptr = tcf_get_base_ptr(skb, cmp->layer) + cmp->off;
+ unsigned char *ptr = tcf_get_base_ptr(skb, cmp->layer);
u32 val = 0;
+ if (!ptr)
+ return 0;
+ ptr += cmp->off;
if (!tcf_valid_offset(skb, ptr, cmp->align))
return 0;