Commit 868ad214 authored by Markus Elfring's avatar Markus Elfring Committed by Kalle Valo

net/wireless: Delete unnecessary checks before the macro call “dev_kfree_skb”

The dev_kfree_skb() function performs also input parameter validation.
Thus the test around the shown calls is not needed.

This issue was detected by using the Coccinelle software.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 52d42618
...@@ -9481,7 +9481,5 @@ void ath10k_wmi_detach(struct ath10k *ar) ...@@ -9481,7 +9481,5 @@ void ath10k_wmi_detach(struct ath10k *ar)
} }
cancel_work_sync(&ar->svc_rdy_work); cancel_work_sync(&ar->svc_rdy_work);
if (ar->svc_rdy_skb)
dev_kfree_skb(ar->svc_rdy_skb); dev_kfree_skb(ar->svc_rdy_skb);
} }
...@@ -2301,8 +2301,6 @@ __il3945_down(struct il_priv *il) ...@@ -2301,8 +2301,6 @@ __il3945_down(struct il_priv *il)
il3945_hw_txq_ctx_free(il); il3945_hw_txq_ctx_free(il);
exit: exit:
memset(&il->card_alive, 0, sizeof(struct il_alive_resp)); memset(&il->card_alive, 0, sizeof(struct il_alive_resp));
if (il->beacon_skb)
dev_kfree_skb(il->beacon_skb); dev_kfree_skb(il->beacon_skb);
il->beacon_skb = NULL; il->beacon_skb = NULL;
...@@ -3846,9 +3844,7 @@ il3945_pci_remove(struct pci_dev *pdev) ...@@ -3846,9 +3844,7 @@ il3945_pci_remove(struct pci_dev *pdev)
il_free_channel_map(il); il_free_channel_map(il);
il_free_geos(il); il_free_geos(il);
kfree(il->scan_cmd); kfree(il->scan_cmd);
if (il->beacon_skb)
dev_kfree_skb(il->beacon_skb); dev_kfree_skb(il->beacon_skb);
ieee80211_free_hw(il->hw); ieee80211_free_hw(il->hw);
} }
......
...@@ -5182,7 +5182,6 @@ il_mac_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -5182,7 +5182,6 @@ il_mac_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
memset(&il->current_ht_config, 0, sizeof(struct il_ht_config)); memset(&il->current_ht_config, 0, sizeof(struct il_ht_config));
/* new association get rid of ibss beacon skb */ /* new association get rid of ibss beacon skb */
if (il->beacon_skb)
dev_kfree_skb(il->beacon_skb); dev_kfree_skb(il->beacon_skb);
il->beacon_skb = NULL; il->beacon_skb = NULL;
il->timestamp = 0; il->timestamp = 0;
...@@ -5302,10 +5301,7 @@ il_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -5302,10 +5301,7 @@ il_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
} }
spin_lock_irqsave(&il->lock, flags); spin_lock_irqsave(&il->lock, flags);
if (il->beacon_skb)
dev_kfree_skb(il->beacon_skb); dev_kfree_skb(il->beacon_skb);
il->beacon_skb = skb; il->beacon_skb = skb;
timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp; timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp;
......
...@@ -77,10 +77,7 @@ int mt76x02_mac_set_beacon(struct mt76x02_dev *dev, u8 vif_idx, ...@@ -77,10 +77,7 @@ int mt76x02_mac_set_beacon(struct mt76x02_dev *dev, u8 vif_idx,
for (i = 0; i < ARRAY_SIZE(dev->beacons); i++) { for (i = 0; i < ARRAY_SIZE(dev->beacons); i++) {
if (vif_idx == i) { if (vif_idx == i) {
force_update = !!dev->beacons[i] ^ !!skb; force_update = !!dev->beacons[i] ^ !!skb;
if (dev->beacons[i])
dev_kfree_skb(dev->beacons[i]); dev_kfree_skb(dev->beacons[i]);
dev->beacons[i] = skb; dev->beacons[i] = skb;
__mt76x02_mac_set_beacon(dev, bcn_idx, skb); __mt76x02_mac_set_beacon(dev, bcn_idx, skb);
} else if (force_update && dev->beacons[i]) { } else if (force_update && dev->beacons[i]) {
......
...@@ -120,7 +120,6 @@ int cw1200_hw_scan(struct ieee80211_hw *hw, ...@@ -120,7 +120,6 @@ int cw1200_hw_scan(struct ieee80211_hw *hw,
++priv->scan.n_ssids; ++priv->scan.n_ssids;
} }
if (frame.skb)
dev_kfree_skb(frame.skb); dev_kfree_skb(frame.skb);
mutex_unlock(&priv->conf_mutex); mutex_unlock(&priv->conf_mutex);
queue_work(priv->workqueue, &priv->scan.work); queue_work(priv->workqueue, &priv->scan.work);
......
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