aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-07-30 09:11:56 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-08-20 08:13:46 -0400
commitdcf33963c48e1959c83fda84e336dbb000eefa3f (patch)
tree9dac796cf1e165a75ab1b2e850b4ddc5a27d40f5 /net/mac80211
parentfe94fe05e9fb7c1bea482d1b0fd09029a711cce2 (diff)
mac80211: clean up ieee80211_subif_start_xmit
There's no need to carry around a return value that is always NETDEV_TX_OK anyway. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/tx.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 2d2f45ecca4d..3b807bcb8fc9 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1719,7 +1719,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1719 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1719 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1720 struct ieee80211_local *local = sdata->local; 1720 struct ieee80211_local *local = sdata->local;
1721 struct ieee80211_tx_info *info; 1721 struct ieee80211_tx_info *info;
1722 int ret = NETDEV_TX_BUSY, head_need; 1722 int head_need;
1723 u16 ethertype, hdrlen, meshhdrlen = 0; 1723 u16 ethertype, hdrlen, meshhdrlen = 0;
1724 __le16 fc; 1724 __le16 fc;
1725 struct ieee80211_hdr hdr; 1725 struct ieee80211_hdr hdr;
@@ -1735,10 +1735,8 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1735 u32 info_flags = 0; 1735 u32 info_flags = 0;
1736 u16 info_id = 0; 1736 u16 info_id = 0;
1737 1737
1738 if (unlikely(skb->len < ETH_HLEN)) { 1738 if (unlikely(skb->len < ETH_HLEN))
1739 ret = NETDEV_TX_OK;
1740 goto fail; 1739 goto fail;
1741 }
1742 1740
1743 /* convert Ethernet header to proper 802.11 header (based on 1741 /* convert Ethernet header to proper 802.11 header (based on
1744 * operation mode) */ 1742 * operation mode) */
@@ -1786,7 +1784,6 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1786 if (!sdata->u.mesh.mshcfg.dot11MeshTTL) { 1784 if (!sdata->u.mesh.mshcfg.dot11MeshTTL) {
1787 /* Do not send frames with mesh_ttl == 0 */ 1785 /* Do not send frames with mesh_ttl == 0 */
1788 sdata->u.mesh.mshstats.dropped_frames_ttl++; 1786 sdata->u.mesh.mshstats.dropped_frames_ttl++;
1789 ret = NETDEV_TX_OK;
1790 goto fail; 1787 goto fail;
1791 } 1788 }
1792 rcu_read_lock(); 1789 rcu_read_lock();
@@ -1879,10 +1876,8 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1879 1876
1880 if (tdls_direct) { 1877 if (tdls_direct) {
1881 /* link during setup - throw out frames to peer */ 1878 /* link during setup - throw out frames to peer */
1882 if (!tdls_auth) { 1879 if (!tdls_auth)
1883 ret = NETDEV_TX_OK;
1884 goto fail; 1880 goto fail;
1885 }
1886 1881
1887 /* DA SA BSSID */ 1882 /* DA SA BSSID */
1888 memcpy(hdr.addr1, skb->data, ETH_ALEN); 1883 memcpy(hdr.addr1, skb->data, ETH_ALEN);
@@ -1916,7 +1911,6 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1916 hdrlen = 24; 1911 hdrlen = 24;
1917 break; 1912 break;
1918 default: 1913 default:
1919 ret = NETDEV_TX_OK;
1920 goto fail; 1914 goto fail;
1921 } 1915 }
1922 1916
@@ -1961,7 +1955,6 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1961 1955
1962 I802_DEBUG_INC(local->tx_handlers_drop_unauth_port); 1956 I802_DEBUG_INC(local->tx_handlers_drop_unauth_port);
1963 1957
1964 ret = NETDEV_TX_OK;
1965 goto fail; 1958 goto fail;
1966 } 1959 }
1967 1960
@@ -2016,10 +2009,8 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
2016 skb = skb_clone(skb, GFP_ATOMIC); 2009 skb = skb_clone(skb, GFP_ATOMIC);
2017 kfree_skb(tmp_skb); 2010 kfree_skb(tmp_skb);
2018 2011
2019 if (!skb) { 2012 if (!skb)
2020 ret = NETDEV_TX_OK;
2021 goto fail; 2013 goto fail;
2022 }
2023 } 2014 }
2024 2015
2025 hdr.frame_control = fc; 2016 hdr.frame_control = fc;
@@ -2122,10 +2113,8 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
2122 return NETDEV_TX_OK; 2113 return NETDEV_TX_OK;
2123 2114
2124 fail: 2115 fail:
2125 if (ret == NETDEV_TX_OK) 2116 dev_kfree_skb(skb);
2126 dev_kfree_skb(skb); 2117 return NETDEV_TX_OK;
2127
2128 return ret;
2129} 2118}
2130 2119
2131 2120