aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_testmode.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_testmode.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_testmode.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_testmode.c b/drivers/net/wireless/wl12xx/wl1271_testmode.c
index 554deb4d024..6e0952f79e9 100644
--- a/drivers/net/wireless/wl12xx/wl1271_testmode.c
+++ b/drivers/net/wireless/wl12xx/wl1271_testmode.c
@@ -199,7 +199,14 @@ static int wl1271_tm_cmd_nvs_push(struct wl1271 *wl, struct nlattr *tb[])
199 buf = nla_data(tb[WL1271_TM_ATTR_DATA]); 199 buf = nla_data(tb[WL1271_TM_ATTR_DATA]);
200 len = nla_len(tb[WL1271_TM_ATTR_DATA]); 200 len = nla_len(tb[WL1271_TM_ATTR_DATA]);
201 201
202 if (len != sizeof(struct wl1271_nvs_file)) { 202 /*
203 * FIXME: the LEGACY NVS image support (NVS's missing the 5GHz band
204 * configurations) can be removed when those NVS files stop floating
205 * around.
206 */
207 if (len != sizeof(struct wl1271_nvs_file) &&
208 (len != WL1271_INI_LEGACY_NVS_FILE_SIZE ||
209 wl1271_11a_enabled())) {
203 wl1271_error("nvs size is not as expected: %zu != %zu", 210 wl1271_error("nvs size is not as expected: %zu != %zu",
204 len, sizeof(struct wl1271_nvs_file)); 211 len, sizeof(struct wl1271_nvs_file));
205 return -EMSGSIZE; 212 return -EMSGSIZE;
@@ -209,7 +216,7 @@ static int wl1271_tm_cmd_nvs_push(struct wl1271 *wl, struct nlattr *tb[])
209 216
210 kfree(wl->nvs); 217 kfree(wl->nvs);
211 218
212 wl->nvs = kmalloc(sizeof(struct wl1271_nvs_file), GFP_KERNEL); 219 wl->nvs = kzalloc(sizeof(struct wl1271_nvs_file), GFP_KERNEL);
213 if (!wl->nvs) { 220 if (!wl->nvs) {
214 wl1271_error("could not allocate memory for the nvs file"); 221 wl1271_error("could not allocate memory for the nvs file");
215 ret = -ENOMEM; 222 ret = -ENOMEM;