forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
....@@ -1,10 +1,10 @@
11 /*
2
- * Marvell Wireless LAN device driver: station command response handling
2
+ * NXP Wireless LAN device driver: station command response handling
33 *
4
- * Copyright (C) 2011-2014, Marvell International Ltd.
4
+ * Copyright 2011-2020 NXP
55 *
6
- * This software file (the "File") is distributed by Marvell International
7
- * Ltd. under the terms of the GNU General Public License Version 2, June 1991
6
+ * This software file (the "File") is distributed by NXP
7
+ * under the terms of the GNU General Public License Version 2, June 1991
88 * (the "License"). You may use, redistribute and/or modify this File in
99 * accordance with the terms and conditions of the License, a copy of which
1010 * is available by writing to the Free Software Foundation, Inc.,
....@@ -46,7 +46,6 @@
4646 {
4747 struct mwifiex_adapter *adapter = priv->adapter;
4848 struct host_cmd_ds_802_11_ps_mode_enh *pm;
49
- unsigned long flags;
5049
5150 mwifiex_dbg(adapter, ERROR,
5251 "CMD_RESP: cmd %#x error, result=%#x\n",
....@@ -87,9 +86,9 @@
8786 /* Handling errors here */
8887 mwifiex_recycle_cmd_node(adapter, adapter->curr_cmd);
8988
90
- spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
89
+ spin_lock_bh(&adapter->mwifiex_cmd_lock);
9190 adapter->curr_cmd = NULL;
92
- spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
91
+ spin_unlock_bh(&adapter->mwifiex_cmd_lock);
9392 }
9493
9594 /*
....@@ -1033,17 +1032,14 @@
10331032 struct ieee80211_regdomain *regd;
10341033 struct ieee80211_reg_rule *rule;
10351034 bool new_rule;
1036
- int regd_size, idx, freq, prev_freq = 0;
1035
+ int idx, freq, prev_freq = 0;
10371036 u32 bw, prev_bw = 0;
10381037 u8 chflags, prev_chflags = 0, valid_rules = 0;
10391038
10401039 if (WARN_ON_ONCE(num_chan > NL80211_MAX_SUPP_REG_RULES))
10411040 return ERR_PTR(-EINVAL);
10421041
1043
- regd_size = sizeof(struct ieee80211_regdomain) +
1044
- num_chan * sizeof(struct ieee80211_reg_rule);
1045
-
1046
- regd = kzalloc(regd_size, GFP_KERNEL);
1042
+ regd = kzalloc(struct_size(regd, reg_rules, num_chan), GFP_KERNEL);
10471043 if (!regd)
10481044 return ERR_PTR(-ENOMEM);
10491045