Commit ccff2f4a authored by Richard Cochran's avatar Richard Cochran Committed by Greg Kroah-Hartman

net: dp83640: Avoid NULL pointer dereference.

commit db9d8b29 upstream.

The function, skb_complete_tx_timestamp(), used to allow passing in a
NULL pointer for the time stamps, but that was changed in commit
62bccb8c ("net-timestamp: Make the
clone operation stand-alone from phy timestamping"), and the existing
call sites, all of which are in the dp83640 driver, were fixed up.

Even though the kernel-doc was subsequently updated in commit
7a76a021 ("net-timestamp: Update
skb_complete_tx_timestamp comment"), still a bug fix from Manfred
Rudigier came into the driver using the old semantics.  Probably
Manfred derived that patch from an older kernel version.

This fix should be applied to the stable trees as well.

Fixes: 81e8f2e9 ("net: dp83640: Fix tx timestamp overflow handling.")
Signed-off-by: default avatarRichard Cochran <richardcochran@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6a87cca3
...@@ -907,7 +907,7 @@ static void decode_txts(struct dp83640_private *dp83640, ...@@ -907,7 +907,7 @@ static void decode_txts(struct dp83640_private *dp83640,
if (overflow) { if (overflow) {
pr_debug("tx timestamp queue overflow, count %d\n", overflow); pr_debug("tx timestamp queue overflow, count %d\n", overflow);
while (skb) { while (skb) {
skb_complete_tx_timestamp(skb, NULL); kfree_skb(skb);
skb = skb_dequeue(&dp83640->tx_queue); skb = skb_dequeue(&dp83640->tx_queue);
} }
return; return;
......
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