Skip to content

Commit

Permalink
net: dsa: sja1105: Fix memory leak on meta state machine error path
Browse files Browse the repository at this point in the history
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: f3097be ("net: dsa: sja1105: Add a state machine for RX timestamping")
Signed-off-by: Vladimir Oltean <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
vladimiroltean authored and davem330 committed Aug 6, 2019
1 parent f163fed commit 93fa858
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/dsa/tag_sja1105.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ static struct sk_buff
"Expected meta frame, is %12llx "
"in the DSA master multicast filter?\n",
SJA1105_META_DMAC);
kfree_skb(sp->data->stampable_skb);
}

/* Hold a reference to avoid dsa_switch_rcv
Expand Down

0 comments on commit 93fa858

Please sign in to comment.