Browse Source

qcacld-3.0: free the skb if osif_vdev_sync_op_start failed

If osif_vdev_sync_op_start failed, that means operation on
net_dev is not permitted. So, free the skb before return.

Change-Id: Icd366c2d9d947e39f26f1b21878bfe0154a55fdc
CRs-Fixed: 2681018
Vevek Venkatesan 4 years ago
parent
commit
cdfa210156
2 changed files with 8 additions and 2 deletions
  1. 4 1
      core/hdd/src/wlan_hdd_softap_tx_rx.c
  2. 4 1
      core/hdd/src/wlan_hdd_tx_rx.c

+ 4 - 1
core/hdd/src/wlan_hdd_softap_tx_rx.c

@@ -733,8 +733,11 @@ netdev_tx_t hdd_softap_hard_start_xmit(struct sk_buff *skb,
 {
 	struct osif_vdev_sync *vdev_sync;
 
-	if (osif_vdev_sync_op_start(net_dev, &vdev_sync))
+	if (osif_vdev_sync_op_start(net_dev, &vdev_sync)) {
+		hdd_debug_rl("Operation on net_dev is not permitted");
+		kfree_skb(skb);
 		return NETDEV_TX_OK;
+	}
 
 	__hdd_softap_hard_start_xmit(skb, net_dev);
 

+ 4 - 1
core/hdd/src/wlan_hdd_tx_rx.c

@@ -1217,8 +1217,11 @@ netdev_tx_t hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *net_dev)
 {
 	struct osif_vdev_sync *vdev_sync;
 
-	if (osif_vdev_sync_op_start(net_dev, &vdev_sync))
+	if (osif_vdev_sync_op_start(net_dev, &vdev_sync)) {
+		hdd_debug_rl("Operation on net_dev is not permitted");
+		kfree_skb(skb);
 		return NETDEV_TX_OK;
+	}
 
 	__hdd_hard_start_xmit(skb, net_dev);