From 40fec37d3abd8b8fd6ab95331b5a98d376bef71b Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Sun, 19 Jan 2025 12:35:47 +0100 Subject: [PATCH 1/2] mt76: fix kernel 6.7 compatibility The PP_FLAG_PAGE_FRAG constant was removed in kernel 6.7, so we are removing it from code for kernels 6.7 and above. Signed-off-by: Mieczyslaw Nalewaj --- .../0001-fix-build-for-linux-6.7.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 package/kernel/mt76/patches/0001-fix-build-for-linux-6.7.patch diff --git a/package/kernel/mt76/patches/0001-fix-build-for-linux-6.7.patch b/package/kernel/mt76/patches/0001-fix-build-for-linux-6.7.patch new file mode 100644 index 00000000000000..5ea06a55c25776 --- /dev/null +++ b/package/kernel/mt76/patches/0001-fix-build-for-linux-6.7.patch @@ -0,0 +1,24 @@ +From: Mieczyslaw Nalewaj +Date: Sun, 19 Jan 2025 12:35:47 +0100 +Subject: [PATCH] mt76: fix kernel 6.7 compatibility + +The PP_FLAG_PAGE_FRAG constant was removed in kernel 6.7, +so we are removing it from code for kernels 6.7 and above. + +Signed-off-by: Mieczyslaw Nalewaj +--- + +--- 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,7,0) + .flags = PP_FLAG_PAGE_FRAG, ++#else ++ .flags = 0, ++#endif + .nid = NUMA_NO_NODE, + .dev = dev->dma_dev, + }; From 5c4199daf58ed97bf6e31f4755ec655ab56b69fd Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Sun, 19 Jan 2025 12:37:01 +0100 Subject: [PATCH 2/2] mt76: fix allocation check and missing memory freeing Fixed allocation checking and freeing buffer memory inside mt76_eeprom_changes() function. Signed-off-by: Mieczyslaw Nalewaj --- ...ion-check-and-missing-memory-freeing.patch | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 package/kernel/mt76/patches/0002-fix-allocation-check-and-missing-memory-freeing.patch diff --git a/package/kernel/mt76/patches/0002-fix-allocation-check-and-missing-memory-freeing.patch b/package/kernel/mt76/patches/0002-fix-allocation-check-and-missing-memory-freeing.patch new file mode 100644 index 00000000000000..bc63ab9fcb5b89 --- /dev/null +++ b/package/kernel/mt76/patches/0002-fix-allocation-check-and-missing-memory-freeing.patch @@ -0,0 +1,28 @@ +From: Mieczyslaw Nalewaj +Date: Sun, 19 Jan 2025 12:37:01 +0100 +Subject: [PATCH] mt76: fix allocation check and missing memory freeing + +Fixed allocation checking and freeing buffer memory +inside mt76_eeprom_changes() function. + +Signed-off-by: Mieczyslaw Nalewaj +--- + +--- 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;