Skip to content

Commit ce4a7ae

Browse files
sheunlhdeller
authored andcommitted
fbdev: offb: replace 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@inria.fr> Signed-off-by: Abdulrasaq Lawani <abdulrasaqolawani@gmail.com> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 6ad959b commit ce4a7ae

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/video/fbdev/offb.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp
357357
par->cmap_type = cmap_gxt2000;
358358
} else if (of_node_name_prefix(dp, "vga,Display-")) {
359359
/* Look for AVIVO initialized by SLOF */
360-
struct device_node *pciparent = of_get_parent(dp);
360+
struct device_node *pciparent __free(device_node) = of_get_parent(dp);
361361
const u32 *vid, *did;
362362
vid = of_get_property(pciparent, "vendor-id", NULL);
363363
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
369369
if (par->cmap_adr)
370370
par->cmap_type = cmap_avivo;
371371
}
372-
of_node_put(pciparent);
373372
} else if (dp && of_device_is_compatible(dp, "qemu,std-vga")) {
374373
#ifdef __BIG_ENDIAN
375374
const __be32 io_of_addr[3] = { 0x01000000, 0x0, 0x0 };

0 commit comments

Comments
 (0)