[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240423012021.56470-1-abdulrasaqolawani@gmail.com>
Date: Mon, 22 Apr 2024 21:20:21 -0400
From: Abdulrasaq Lawani <abdulrasaqolawani@...il.com>
To: deller@....de,
sam@...nborg.org,
tzimmermann@...e.de,
christophe.jaillet@...adoo.fr,
u.kleine-koenig@...gutronix.de,
julia.lawall@...ia.fr
Cc: Abdulrasaq Lawani <abdulrasaqolawani@...il.com>,
linux-fbdev@...r.kernel.org,
dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org,
skhan@...uxfoundation.org,
javier.carrasco.cruz@...il.com
Subject: [PATCH] video: fbdev: replacing of_node_put with __free(device_node)
Replaced instance of of_node_put with __free(device_node)
to simplify code and protect against any memory leaks
due to future changes in the control flow.
Suggested-by: Julia Lawall <julia.lawall@...ia.fr>
Signed-off-by: Abdulrasaq Lawani <abdulrasaqolawani@...il.com>
---
drivers/video/fbdev/offb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c
index b421b46d88ef..ea38a260774b 100644
--- a/drivers/video/fbdev/offb.c
+++ b/drivers/video/fbdev/offb.c
@@ -357,7 +357,7 @@ static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp
par->cmap_type = cmap_gxt2000;
} else if (of_node_name_prefix(dp, "vga,Display-")) {
/* Look for AVIVO initialized by SLOF */
- struct device_node *pciparent = of_get_parent(dp);
+ struct device_node *pciparent __free(device_node) = of_get_parent(dp);
const u32 *vid, *did;
vid = of_get_property(pciparent, "vendor-id", NULL);
did = of_get_property(pciparent, "device-id", NULL);
@@ -369,7 +369,6 @@ static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp
if (par->cmap_adr)
par->cmap_type = cmap_avivo;
}
- of_node_put(pciparent);
} else if (dp && of_device_is_compatible(dp, "qemu,std-vga")) {
#ifdef __BIG_ENDIAN
const __be32 io_of_addr[3] = { 0x01000000, 0x0, 0x0 };
--
2.34.1
Powered by blists - more mailing lists