git: da048bd318b3 - stable/13 - ofw: fix memory leak in ofwbus_attach()

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Mon, 17 Apr 2023 13:38:06 UTC
The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=da048bd318b3d144de0d4ad9596963d978a75e0f

commit da048bd318b3d144de0d4ad9596963d978a75e0f
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2023-04-10 15:31:46 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-04-17 13:34:02 +0000

    ofw: fix memory leak in ofwbus_attach()
    
    PR:             269509
    Reported by:    Jaroslaw Pelczar <jarek@jpelczar.com>
    Reviewed by:    markj
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D38903
    
    (cherry picked from commit 38594ff9c0c9568b5082ba3273103904a6afd38e)
---
 sys/dev/ofw/ofwbus.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/dev/ofw/ofwbus.c b/sys/dev/ofw/ofwbus.c
index 2a28a928e15e..6ea5be694af6 100644
--- a/sys/dev/ofw/ofwbus.c
+++ b/sys/dev/ofw/ofwbus.c
@@ -175,6 +175,7 @@ ofwbus_attach(device_t dev)
 		if (ofw_bus_gen_setup_devinfo(&obd, node) != 0)
 			continue;
 		simplebus_add_device(dev, node, 0, NULL, -1, NULL);
+		ofw_bus_gen_destroy_devinfo(&obd);
 	}
 	return (bus_generic_attach(dev));
 }