]> www.infradead.org Git - users/jedix/linux-maple.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)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 26 Feb 2017 06:03:00 +0000 (22:03 -0800)
commit36e284bb1dbeaaca42a1e61f09562e6fd117f0ab
treeefd41d614c4fe0500c1f943591a5031cf69c3236
parent08e1ce359e5276354ef702ecc748a3b703b016a4
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>
Orabug: 25394529
(cherry picked from commit c23544b196e72716244108fb173f2965e9eafd1a)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
drivers/net/ethernet/intel/fm10k/fm10k_ptp.c