mt76: temporary patch for kernel 6.12 (version 2)
authorMieczyslaw Nalewaj <namiltd@yahoo.com>
Mon, 9 Dec 2024 12:44:56 +0000 (13:44 +0100)
committerZoltan HERPAI <wigyori@uid0.hu>
Tue, 17 Dec 2024 22:28:12 +0000 (23:28 +0100)
Temporary patch for kernel 6.12 (version 2)
additionally fixed allocation check and missing memory deallocation.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
package/kernel/mt76/patches/999-01-patch.patch [new file with mode: 0644]
package/kernel/mt76/patches/999-02-patch.patch [new file with mode: 0644]

diff --git a/package/kernel/mt76/patches/999-01-patch.patch b/package/kernel/mt76/patches/999-01-patch.patch
new file mode 100644 (file)
index 0000000..3c3f82a
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/mac80211.c
++++ b/mac80211.c
+@@ -613,7 +613,11 @@ int mt76_create_page_pool(struct mt76_de
+ {
+       struct page_pool_params pp_params = {
+               .order = 0,
++#if LINUX_VERSION_IS_LESS(6,12,0)
+               .flags = PP_FLAG_PAGE_FRAG,
++#else
++              .flags = 0,
++#endif
+               .nid = NUMA_NO_NODE,
+               .dev = dev->dma_dev,
+       };
diff --git a/package/kernel/mt76/patches/999-02-patch.patch b/package/kernel/mt76/patches/999-02-patch.patch
new file mode 100644 (file)
index 0000000..aca9296
--- /dev/null
@@ -0,0 +1,18 @@
+--- a/tools/eeprom.c
++++ b/tools/eeprom.c
+@@ -220,10 +220,14 @@ mt76_eeprom_changes(void)
+       }
+       buf = malloc(EEPROM_PART_SIZE);
++      if (!buf)
++              return EXIT_FAILURE;
+       fseek(f, mtd_offset, SEEK_SET);
+       ret = fread(buf, 1, EEPROM_PART_SIZE, f);
+-      if (ret != EEPROM_PART_SIZE)
++      if (ret != EEPROM_PART_SIZE) {
++              free(buf);
+               return EXIT_FAILURE;
++      }
+       for (i = 0; i < EEPROM_PART_SIZE; i++) {
+               if (buf[i] == eeprom_data[i])
+                       continue;