Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / drivers / net / wireless / wl12xx / wl1271_testmode.c
index 554deb4d024eae483d6895a5da9b86868d26c158..6e0952f79e9a79e942a4ed3182ab6f419cba07c6 100644 (file)
@@ -199,7 +199,14 @@ static int wl1271_tm_cmd_nvs_push(struct wl1271 *wl, struct nlattr *tb[])
        buf = nla_data(tb[WL1271_TM_ATTR_DATA]);
        len = nla_len(tb[WL1271_TM_ATTR_DATA]);
 
-       if (len != sizeof(struct wl1271_nvs_file)) {
+       /*
+        * FIXME: the LEGACY NVS image support (NVS's missing the 5GHz band
+        * configurations) can be removed when those NVS files stop floating
+        * around.
+        */
+       if (len != sizeof(struct wl1271_nvs_file) &&
+           (len != WL1271_INI_LEGACY_NVS_FILE_SIZE ||
+            wl1271_11a_enabled())) {
                wl1271_error("nvs size is not as expected: %zu != %zu",
                             len, sizeof(struct wl1271_nvs_file));
                return -EMSGSIZE;
@@ -209,7 +216,7 @@ static int wl1271_tm_cmd_nvs_push(struct wl1271 *wl, struct nlattr *tb[])
 
        kfree(wl->nvs);
 
-       wl->nvs = kmalloc(sizeof(struct wl1271_nvs_file), GFP_KERNEL);
+       wl->nvs = kzalloc(sizeof(struct wl1271_nvs_file), GFP_KERNEL);
        if (!wl->nvs) {
                wl1271_error("could not allocate memory for the nvs file");
                ret = -ENOMEM;