mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 3/3] partitions: efi: remove unnecessary NULLing of local variable
Date: Mon, 25 Nov 2024 16:27:56 +0100	[thread overview]
Message-ID: <20241125152756.513705-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20241125152756.513705-1-a.fatoum@pengutronix.de>

The variables are local and go out of scope anyway, so no point in
NULLing just before scope ends.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/partitions/efi.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/common/partitions/efi.c b/common/partitions/efi.c
index 968b959397b5..af7eacfe3b68 100644
--- a/common/partitions/efi.c
+++ b/common/partitions/efi.c
@@ -122,7 +122,6 @@ static gpt_entry *alloc_read_gpt_entries(struct block_device *blk,
 	ret = block_read(blk, pte, from, size);
 	if (ret) {
 		free(pte);
-		pte=NULL;
 		return NULL;
 	}
 	return pte;
@@ -157,7 +156,6 @@ static gpt_header *alloc_read_gpt_header(struct block_device *blk,
 	ret = block_read(blk, gpt, lba, 1);
 	if (ret) {
 		free(gpt);
-		gpt=NULL;
 		return NULL;
 	}
 
-- 
2.39.5




      parent reply	other threads:[~2024-11-25 15:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-25 15:27 [PATCH 1/3] partitions: dos: fix memory leaks Ahmad Fatoum
2024-11-25 15:27 ` [PATCH 2/3] partitions: efi: remove guid device parameter on free Ahmad Fatoum
2024-11-25 15:27 ` Ahmad Fatoum [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=20241125152756.513705-3-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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