mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
qcacld-3.0: Avoid NULL skb dereference during softap TX
Change "qcacld-3.0: Record data in DP Trace" introduced skb tracing functionity to the driver. In hdd_softap_hard_start_xmit() logic was added to trace the skb contents, including logic to trace the skb contents when an skb was dropped. However some of the code paths to this "drop_pkt" tracing have a NULL skb. Therefore we must bypass the dropped skb content tracing when the skb is NULL. Change-Id: I485c92647355a0f7f420f40640b697a1d3eb5fb0 CRs-Fixed: 938254
This commit is contained in:
parent
052c6e6b30
commit
edeff23d4f
1 changed files with 4 additions and 3 deletions
|
|
@ -288,7 +288,7 @@ int hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
/* Check if the buffer has enough header room */
|
||||
skb = skb_unshare(skb, GFP_ATOMIC);
|
||||
if (!skb)
|
||||
goto drop_pkt;
|
||||
goto drop_pkt_accounting;
|
||||
|
||||
if (skb_headroom(skb) < dev->hard_header_len) {
|
||||
struct sk_buff *tmp;
|
||||
|
|
@ -296,7 +296,7 @@ int hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
skb = skb_realloc_headroom(tmp, dev->hard_header_len);
|
||||
dev_kfree_skb(tmp);
|
||||
if (!skb)
|
||||
goto drop_pkt;
|
||||
goto drop_pkt_accounting;
|
||||
}
|
||||
#if defined (IPA_OFFLOAD)
|
||||
}
|
||||
|
|
@ -357,10 +357,11 @@ drop_pkt:
|
|||
DPTRACE(cdf_dp_trace(skb, CDF_DP_TRACE_DROP_PACKET_RECORD,
|
||||
(uint8_t *)&skb->data[CDF_DP_TRACE_RECORD_SIZE],
|
||||
(cdf_nbuf_len(skb)-CDF_DP_TRACE_RECORD_SIZE)));
|
||||
kfree_skb(skb);
|
||||
|
||||
drop_pkt_accounting:
|
||||
++pAdapter->stats.tx_dropped;
|
||||
++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped;
|
||||
kfree_skb(skb);
|
||||
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue