]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Drop firmware-stratix10-svc-fix-memory-leaks-and-list-corruption-bugs.patch from...
authorSasha Levin <sashal@kernel.org>
Wed, 29 Jul 2026 21:28:38 +0000 (17:28 -0400)
committerSasha Levin <sashal@kernel.org>
Wed, 29 Jul 2026 21:28:38 +0000 (17:28 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-6.1/firmware-stratix10-svc-fix-memory-leaks-and-list-corruption-bugs.patch [deleted file]
queue-6.1/series
queue-6.6/firmware-stratix10-svc-fix-memory-leaks-and-list-corruption-bugs.patch [deleted file]
queue-6.6/series

diff --git a/queue-6.1/firmware-stratix10-svc-fix-memory-leaks-and-list-corruption-bugs.patch b/queue-6.1/firmware-stratix10-svc-fix-memory-leaks-and-list-corruption-bugs.patch
deleted file mode 100644 (file)
index ec07aba..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-From 9119ceb76e987c2ec2b549ea100e3268ce3a1c7c Mon Sep 17 00:00:00 2001
-From: Tze Yee Ng <tze.yee.ng@altera.com>
-Date: Wed, 24 Jun 2026 03:06:35 -0700
-Subject: firmware: stratix10-svc: fix memory leaks and list corruption bugs
-
-From: Tze Yee Ng <tze.yee.ng@altera.com>
-
-commit 9119ceb76e987c2ec2b549ea100e3268ce3a1c7c upstream.
-
-Fix a memory leak when gen_pool_alloc() fails by freeing pmem on the error
-path. Switch pmem allocation from devm_kzalloc() to kzalloc() with
-explicit kfree() in the free path to match its list-managed lifetime.
-Remove the erroneous list_del(&svc_data_mem) which corrupted the list head
-on failed lookups.
-
-Fixes: 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver")
-Cc: stable@vger.kernel.org # 5.0+
-Signed-off-by: Tze Yee Ng <tze.yee.ng@altera.com>
-Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- drivers/firmware/stratix10-svc.c |   10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
---- a/drivers/firmware/stratix10-svc.c
-+++ b/drivers/firmware/stratix10-svc.c
-@@ -1065,14 +1065,16 @@ void *stratix10_svc_allocate_memory(stru
-       struct gen_pool *genpool = chan->ctrl->genpool;
-       size_t s = roundup(size, 1 << genpool->min_alloc_order);
--      pmem = devm_kzalloc(chan->ctrl->dev, sizeof(*pmem), GFP_KERNEL);
-+      pmem = kzalloc_obj(*pmem);
-       if (!pmem)
-               return ERR_PTR(-ENOMEM);
-       guard(mutex)(&svc_mem_lock);
-       va = gen_pool_alloc(genpool, s);
--      if (!va)
-+      if (!va) {
-+              kfree(pmem);
-               return ERR_PTR(-ENOMEM);
-+      }
-       memset((void *)va, 0, s);
-       pa = gen_pool_virt_to_phys(genpool, va);
-@@ -1098,6 +1100,7 @@ EXPORT_SYMBOL_GPL(stratix10_svc_allocate
- void stratix10_svc_free_memory(struct stratix10_svc_chan *chan, void *kaddr)
- {
-       struct stratix10_svc_data_mem *pmem;
-+
-       guard(mutex)(&svc_mem_lock);
-       list_for_each_entry(pmem, &svc_data_mem, node)
-@@ -1106,10 +1109,9 @@ void stratix10_svc_free_memory(struct st
-                                      (unsigned long)kaddr, pmem->size);
-                       pmem->vaddr = NULL;
-                       list_del(&pmem->node);
-+                      kfree(pmem);
-                       return;
-               }
--
--      list_del(&svc_data_mem);
- }
- EXPORT_SYMBOL_GPL(stratix10_svc_free_memory);
index a7664cffa3628ffff2f8455b74d335a5a77b0c22..e2e0c4a7b5d0ba0f82d0e646e7cb18c989692f94 100644 (file)
@@ -231,7 +231,6 @@ exec-fix-unsigned-loop-counter-wrap-in-transfer_args_to_stack.patch
 binfmt_misc-set-have_execfd-only-once-the-interpreter-is-opened.patch
 platform-loongarch-laptop-explicitly-reset-bl_powered-state-when-suspend.patch
 cdrom-fix-stack-out-of-bounds-read-in-cdromvolctrl.patch
-firmware-stratix10-svc-fix-memory-leaks-and-list-corruption-bugs.patch
 x86-boot-compressed-disable-jump-tables.patch
 comedi-comedi_parport-deal-with-premature-interrupt.patch
 serial-sc16is7xx-implement-gpio-get_direction-callback.patch
diff --git a/queue-6.6/firmware-stratix10-svc-fix-memory-leaks-and-list-corruption-bugs.patch b/queue-6.6/firmware-stratix10-svc-fix-memory-leaks-and-list-corruption-bugs.patch
deleted file mode 100644 (file)
index 2218ff4..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-From 9119ceb76e987c2ec2b549ea100e3268ce3a1c7c Mon Sep 17 00:00:00 2001
-From: Tze Yee Ng <tze.yee.ng@altera.com>
-Date: Wed, 24 Jun 2026 03:06:35 -0700
-Subject: firmware: stratix10-svc: fix memory leaks and list corruption bugs
-
-From: Tze Yee Ng <tze.yee.ng@altera.com>
-
-commit 9119ceb76e987c2ec2b549ea100e3268ce3a1c7c upstream.
-
-Fix a memory leak when gen_pool_alloc() fails by freeing pmem on the error
-path. Switch pmem allocation from devm_kzalloc() to kzalloc() with
-explicit kfree() in the free path to match its list-managed lifetime.
-Remove the erroneous list_del(&svc_data_mem) which corrupted the list head
-on failed lookups.
-
-Fixes: 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver")
-Cc: stable@vger.kernel.org # 5.0+
-Signed-off-by: Tze Yee Ng <tze.yee.ng@altera.com>
-Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- drivers/firmware/stratix10-svc.c |   10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
---- a/drivers/firmware/stratix10-svc.c
-+++ b/drivers/firmware/stratix10-svc.c
-@@ -1083,14 +1083,16 @@ void *stratix10_svc_allocate_memory(stru
-       struct gen_pool *genpool = chan->ctrl->genpool;
-       size_t s = roundup(size, 1 << genpool->min_alloc_order);
--      pmem = devm_kzalloc(chan->ctrl->dev, sizeof(*pmem), GFP_KERNEL);
-+      pmem = kzalloc_obj(*pmem);
-       if (!pmem)
-               return ERR_PTR(-ENOMEM);
-       guard(mutex)(&svc_mem_lock);
-       va = gen_pool_alloc(genpool, s);
--      if (!va)
-+      if (!va) {
-+              kfree(pmem);
-               return ERR_PTR(-ENOMEM);
-+      }
-       memset((void *)va, 0, s);
-       pa = gen_pool_virt_to_phys(genpool, va);
-@@ -1116,6 +1118,7 @@ EXPORT_SYMBOL_GPL(stratix10_svc_allocate
- void stratix10_svc_free_memory(struct stratix10_svc_chan *chan, void *kaddr)
- {
-       struct stratix10_svc_data_mem *pmem;
-+
-       guard(mutex)(&svc_mem_lock);
-       list_for_each_entry(pmem, &svc_data_mem, node)
-@@ -1124,10 +1127,9 @@ void stratix10_svc_free_memory(struct st
-                                      (unsigned long)kaddr, pmem->size);
-                       pmem->vaddr = NULL;
-                       list_del(&pmem->node);
-+                      kfree(pmem);
-                       return;
-               }
--
--      list_del(&svc_data_mem);
- }
- EXPORT_SYMBOL_GPL(stratix10_svc_free_memory);
index 1d4acc366569d2a654f31ccae1453d45396fdfd4..0b64a711e39932a8dc7df9001feae9cfb7f5a0dd 100644 (file)
@@ -283,7 +283,6 @@ binfmt_misc-set-have_execfd-only-once-the-interpreter-is-opened.patch
 platform-loongarch-laptop-explicitly-reset-bl_powered-state-when-suspend.patch
 loongarch-fix-oops-during-single-step-debugging.patch
 cdrom-fix-stack-out-of-bounds-read-in-cdromvolctrl.patch
-firmware-stratix10-svc-fix-memory-leaks-and-list-corruption-bugs.patch
 x86-boot-compressed-disable-jump-tables.patch
 comedi-comedi_parport-deal-with-premature-interrupt.patch
 serial-sc16is7xx-implement-gpio-get_direction-callback.patch