Commit 93fa8587 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by David S. Miller

net: dsa: sja1105: Fix memory leak on meta state machine error path

When RX timestamping is enabled and two link-local (non-meta) frames are
received in a row, this constitutes an error.

The tagger is always caching the last link-local frame, in an attempt to
merge it with the meta follow-up frame when that arrives. To recover
from the above error condition, the initial cached link-local frame is
dropped and the second frame in a row is cached (in expectance of the
second meta frame).

However, when dropping the initial link-local frame, its backing memory
was being leaked.

Fixes: f3097be2 ("net: dsa: sja1105: Add a state machine for RX timestamping")
Signed-off-by: default avatarVladimir Oltean <olteanv@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f163fed2
...@@ -165,6 +165,7 @@ static struct sk_buff ...@@ -165,6 +165,7 @@ static struct sk_buff
"Expected meta frame, is %12llx " "Expected meta frame, is %12llx "
"in the DSA master multicast filter?\n", "in the DSA master multicast filter?\n",
SJA1105_META_DMAC); SJA1105_META_DMAC);
kfree_skb(sp->data->stampable_skb);
} }
/* Hold a reference to avoid dsa_switch_rcv /* Hold a reference to avoid dsa_switch_rcv
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment