From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Mahmoud Mandour <ma.mandourr@gmail.com>, qemu-devel@nongnu.org
Cc: Thomas Huth <thuth@redhat.com>, Cornelia Huck <cohuck@redhat.com>,
"open list:S390-ccw boot" <qemu-s390x@nongnu.org>
Subject: Re: [PATCH 4/9] pc-bios/s390-ccw/netmain.c: Changed a malloc/free to GLib's variants
Date: Sat, 13 Mar 2021 19:50:10 +0100 [thread overview]
Message-ID: <04476a7d-5c6f-3f17-834c-cc0cebfc5c18@de.ibm.com> (raw)
In-Reply-To: <20210313163653.37089-5-ma.mandourr@gmail.com>
On 13.03.21 17:36, Mahmoud Mandour wrote:
> Changed a call to malloc() and its respective calls free() with
> GLib's allocation and deallocation functions.
>
> Signed-off-by: Mahmoud Mandour <ma.mandourr@gmail.com>
Nack.
This is BIOS code and it does not have glib.
> ---
> pc-bios/s390-ccw/netmain.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c
> index 056e93a818..7f78150144 100644
> --- a/pc-bios/s390-ccw/netmain.c
> +++ b/pc-bios/s390-ccw/netmain.c
> @@ -243,7 +243,7 @@ static const char *get_uuid(void)
> int i, cc, chk = 0;
> static char uuid_str[37];
>
> - mem = malloc(2 * PAGE_SIZE);
> + mem = g_try_malloc(2 * PAGE_SIZE);
> if (!mem) {
> puts("Out of memory ... can not get UUID.");
> return NULL;
> @@ -261,7 +261,7 @@ static const char *get_uuid(void)
> : "d" (r0), "d" (r1), [addr] "a" (buf)
> : "cc", "memory");
> if (cc) {
> - free(mem);
> + g_free(mem);
> return NULL;
> }
>
> @@ -269,7 +269,7 @@ static const char *get_uuid(void)
> uuid[i] = buf[STSI322_VMDB_UUID_OFFSET + i];
> chk |= uuid[i];
> }
> - free(mem);
> + g_free(mem);
> if (!chk) {
> return NULL;
> }
>
next prev parent reply other threads:[~2021-03-13 18:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-13 16:36 [PATCH 0/9] Replacing malloc and the like with GLib's variants Mahmoud Mandour
2021-03-13 16:36 ` [PATCH 1/9] bsd-user/elfload.c: Replaced calls to malloc/free with GLib variants Mahmoud Mandour
2021-03-13 16:36 ` [PATCH 2/9] hw/audio/fmopl.c: Fixing some style errors Mahmoud Mandour
2021-03-13 16:36 ` [PATCH 3/9] hw/audio/fmopl.c: Replaced calls to malloc with GLib's variants Mahmoud Mandour
2021-03-13 16:36 ` [PATCH 4/9] pc-bios/s390-ccw/netmain.c: Changed a malloc/free to " Mahmoud Mandour
2021-03-13 18:50 ` Christian Borntraeger [this message]
2021-03-14 2:12 ` Mahmoud Mandour
2021-03-13 16:36 ` [PATCH 5/9] target/xtensa: Replaced malloc/free with " Mahmoud Mandour
2021-03-13 16:36 ` [PATCH 6/9] util/compatfd.c: Replaced a malloc with GLib's g_try_malloc Mahmoud Mandour
2021-03-13 16:36 ` [PATCH 7/9] tools/virtiofsd/buffer.c: replaced a calloc call with GLib's g_try_new0 Mahmoud Mandour
2021-03-13 16:36 ` [PATCH 8/9] tools/virtiofsd/fuse_opt.c: Replaced a malloc with GLib's g_try_malloc Mahmoud Mandour
2021-03-13 16:36 ` [PATCH 9/9] tools/virtiofsd: Replacing malloc-like calls with GLib's variants Mahmoud Mandour
2021-03-13 16:54 ` [PATCH 0/9] Replacing malloc and the like " no-reply
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=04476a7d-5c6f-3f17-834c-cc0cebfc5c18@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=ma.mandourr@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=thuth@redhat.com \
/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).