public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] mcb: update for 6.15
@ 2025-03-10  8:46 Johannes Thumshirn
  2025-03-10  8:46 ` [PATCH 1/1] mcb: fix a double free bug in chameleon_parse_gdd() Johannes Thumshirn
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Thumshirn @ 2025-03-10  8:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Haoxiang Li, Johannes Thumshirn

Hi Greg,

Here's an update for drivers/mcb for 6.15 from Haoxiang Li fixing a double
free in an error path in chameleon_parse_gdd().

Haoxiang Li (1):
  mcb: fix a double free bug in chameleon_parse_gdd()

 drivers/mcb/mcb-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] mcb: fix a double free bug in chameleon_parse_gdd()
  2025-03-10  8:46 [PATCH 0/1] mcb: update for 6.15 Johannes Thumshirn
@ 2025-03-10  8:46 ` Johannes Thumshirn
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Thumshirn @ 2025-03-10  8:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Haoxiang Li, stable, Johannes Thumshirn

From: Haoxiang Li <haoxiang_li2024@163.com>

In chameleon_parse_gdd(), if mcb_device_register() fails, 'mdev'
would be released in mcb_device_register() via put_device().
Thus, goto 'err' label and free 'mdev' again causes a double free.
Just return if mcb_device_register() fails.

Fixes: 3764e82e5150 ("drivers: Introduce MEN Chameleon Bus")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Signed-off-by: Johannes Thumshirn <jth@kernel.org>
---
 drivers/mcb/mcb-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mcb/mcb-parse.c b/drivers/mcb/mcb-parse.c
index 02a680c73979..bf0d7d58c8b0 100644
--- a/drivers/mcb/mcb-parse.c
+++ b/drivers/mcb/mcb-parse.c
@@ -96,7 +96,7 @@ static int chameleon_parse_gdd(struct mcb_bus *bus,
 
 	ret = mcb_device_register(bus, mdev);
 	if (ret < 0)
-		goto err;
+		return ret;
 
 	return 0;
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-03-10  8:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-10  8:46 [PATCH 0/1] mcb: update for 6.15 Johannes Thumshirn
2025-03-10  8:46 ` [PATCH 1/1] mcb: fix a double free bug in chameleon_parse_gdd() Johannes Thumshirn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox