]> git.baikalelectronics.ru Git - kernel.git/commit
fm10k: fix incorrect free on skb in ts_tx_enqueue
authorJacob Keller <jacob.e.keller@intel.com>
Wed, 3 Jun 2015 23:31:01 +0000 (16:31 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 17 Jun 2015 21:20:36 +0000 (14:20 -0700)
commitde42f729a5311fc04d80d2ae38678832cd16bb59
tree2c9bdc11748497f6badee63c8854f77f09f85142
parentafad68e2cd9baf46edc01dff4d56064b3b67a0db
fm10k: fix incorrect free on skb in ts_tx_enqueue

This patch resolves a bug in the ts_tx_enqueue code responsible for a
NULL pointer dereference and invalid access of the skb list. We
incorrectly freed the actual skb we found instead of our copy. Thus the
skb queue is essentially invalidated. Resolve this by freeing our clone
in the cases where we did not add it to the queue. This also avoids the
skb memory leak caused by failure to free the clone.

[  589.719320] BUG: unable to handle kernel NULL pointer dereference at           (null)
[  589.722344] IP: [<ffffffffa0310e60>] fm10k_ts_tx_subtask+0xb0/0x160 [fm10k]
[  589.723796] PGD 0
[  589.725228] Oops: 0000 [#1] SMP

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/fm10k/fm10k_ptp.c