From: Helge Deller <deller@gmx.de>
To: Abdulrasaq Lawani <abdulrasaqolawani@gmail.com>,
sam@ravnborg.org, tzimmermann@suse.de,
christophe.jaillet@wanadoo.fr, u.kleine-koenig@pengutronix.de,
julia.lawall@inria.fr
Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, skhan@linuxfoundation.org,
javier.carrasco.cruz@gmail.com
Subject: Re: [PATCH] video: fbdev: replacing of_node_put with __free(device_node)
Date: Thu, 25 Apr 2024 12:13:33 +0200 [thread overview]
Message-ID: <784db573-5903-4c13-b0ad-fdeeb7b649de@gmx.de> (raw)
In-Reply-To: <20240423012021.56470-1-abdulrasaqolawani@gmail.com>
On 4/23/24 03:20, Abdulrasaq Lawani wrote:
> 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>
applied.
Thanks!
Helge
> ---
> 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 };
prev parent reply other threads:[~2024-04-25 10:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-23 1:20 [PATCH] video: fbdev: replacing of_node_put with __free(device_node) Abdulrasaq Lawani
2024-04-25 10:13 ` Helge Deller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=784db573-5903-4c13-b0ad-fdeeb7b649de@gmx.de \
--to=deller@gmx.de \
--cc=abdulrasaqolawani@gmail.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dri-devel@lists.freedesktop.org \
--cc=javier.carrasco.cruz@gmail.com \
--cc=julia.lawall@inria.fr \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=skhan@linuxfoundation.org \
--cc=tzimmermann@suse.de \
--cc=u.kleine-koenig@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).