diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2016-03-17 22:27:31 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2016-04-07 12:37:48 -0400 |
commit | 37190b2694911552c09119e2b23e65049bf47a1e (patch) | |
tree | 026ce476294cdbcd4e97f3f7d08a3772fc096ba3 | |
parent | ab2ef1d68f62d9e2ec6e494668f288fc000fe886 (diff) |
rsi: Move variable initialisation into error code
In rsi_send_data_pkt(), it's a little more logical to assign 'status' in
the actual error handling code as opposed to at the top of the functon.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
[Deleted controversial bits, rewrote commit message]
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r-- | drivers/net/wireless/rsi/rsi_91x_pkt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/rsi/rsi_91x_pkt.c b/drivers/net/wireless/rsi/rsi_91x_pkt.c index 4322df1fefdc..a0b31c0cf25b 100644 --- a/drivers/net/wireless/rsi/rsi_91x_pkt.c +++ b/drivers/net/wireless/rsi/rsi_91x_pkt.c | |||
@@ -31,7 +31,7 @@ int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb) | |||
31 | struct ieee80211_tx_info *info; | 31 | struct ieee80211_tx_info *info; |
32 | struct skb_info *tx_params; | 32 | struct skb_info *tx_params; |
33 | struct ieee80211_bss_conf *bss; | 33 | struct ieee80211_bss_conf *bss; |
34 | int status = -EINVAL; | 34 | int status; |
35 | u8 ieee80211_size = MIN_802_11_HDR_LEN; | 35 | u8 ieee80211_size = MIN_802_11_HDR_LEN; |
36 | u8 extnd_size; | 36 | u8 extnd_size; |
37 | __le16 *frame_desc; | 37 | __le16 *frame_desc; |
@@ -41,8 +41,10 @@ int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb) | |||
41 | bss = &info->control.vif->bss_conf; | 41 | bss = &info->control.vif->bss_conf; |
42 | tx_params = (struct skb_info *)info->driver_data; | 42 | tx_params = (struct skb_info *)info->driver_data; |
43 | 43 | ||
44 | if (!bss->assoc) | 44 | if (!bss->assoc) { |
45 | status = -EINVAL; | ||
45 | goto err; | 46 | goto err; |
47 | } | ||
46 | 48 | ||
47 | tmp_hdr = (struct ieee80211_hdr *)&skb->data[0]; | 49 | tmp_hdr = (struct ieee80211_hdr *)&skb->data[0]; |
48 | seq_num = (le16_to_cpu(tmp_hdr->seq_ctrl) >> 4); | 50 | seq_num = (le16_to_cpu(tmp_hdr->seq_ctrl) >> 4); |