All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Changed malloc and free to g_malloc and g_free in util/compatfd.c file
@ 2017-04-11 20:04 Prerna Garg
  2017-04-12 10:20 ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Prerna Garg @ 2017-04-11 20:04 UTC (permalink / raw)
  To: qemu-devel, kwolf, Stefan Hajnoczi, Alberto Garcia

[-- Attachment #1: Type: text/plain, Size: 2 bytes --]



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-Changed-malloc-and-free-to-g_malloc-and-g_free-in-ut.patch --]
[-- Type: text/x-patch; name="0002-Changed-malloc-and-free-to-g_malloc-and-g_free-in-ut.patch", Size: 870 bytes --]

From 9e25fdf1ea3e4f52a72bfefc053a701989b7af24 Mon Sep 17 00:00:00 2001
From: Prerna Garg <prerna.garg@live.com>
Date: Wed, 12 Apr 2017 01:29:40 +0530
Subject: [PATCH 2/2] Changed malloc and free to g_malloc and g_free in
 util/compatfd.c

Signed-off-by: Prerna Garg <prerna.garg@live.com>
---
 util/compatfd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/util/compatfd.c b/util/compatfd.c
index 980bd33..7bf1344 100644
--- a/util/compatfd.c
+++ b/util/compatfd.c
@@ -71,14 +71,14 @@ static int qemu_signalfd_compat(const sigset_t *mask)
     QemuThread thread;
     int fds[2];
 
-    info = malloc(sizeof(*info));
+    info = g_malloc(sizeof(*info));
     if (info == NULL) {
         errno = ENOMEM;
         return -1;
     }
 
     if (pipe(fds) == -1) {
-        free(info);
+        g_free(info);
         return -1;
     }
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] Changed malloc and free to g_malloc and g_free in util/compatfd.c file
  2017-04-11 20:04 [Qemu-devel] [PATCH] Changed malloc and free to g_malloc and g_free in util/compatfd.c file Prerna Garg
@ 2017-04-12 10:20 ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2017-04-12 10:20 UTC (permalink / raw)
  To: Prerna Garg; +Cc: qemu-devel, kwolf, Alberto Garcia

[-- Attachment #1: Type: text/plain, Size: 1861 bytes --]

On Tue, Apr 11, 2017 at 08:04:43PM +0000, Prerna Garg wrote:
> From 9e25fdf1ea3e4f52a72bfefc053a701989b7af24 Mon Sep 17 00:00:00 2001
> From: Prerna Garg <prerna.garg@live.com>
> Date: Wed, 12 Apr 2017 01:29:40 +0530

Please resend using git-send-email(1) so that email is properly
formatted for git-am(1) and other tools who will process it.

qemu-devel@nongnu.org receives many patch emails every day that both
human maintainers and bots process.  Unfortunately free-form patch
submission doesn't scale so we all have to follow the guidelines:
http://wiki.qemu-project.org/Contribute/SubmitAPatch

I suggest sending the email to just yourself first so you can confirm
that it meets the guidelines.

> Subject: [PATCH 2/2] Changed malloc and free to g_malloc and g_free in
>  util/compatfd.c

Please follow the commit message conventions:

  compatfd: replace malloc() with g_malloc()

The first part is a prefix that indicates which component in QEMU is
affected.  You can use "git log path/to/file.c" to see what prefix is
commonly used for a file.

The second part is a brief summary written in present imperative.

> 
> Signed-off-by: Prerna Garg <prerna.garg@live.com>
> ---
>  util/compatfd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/util/compatfd.c b/util/compatfd.c
> index 980bd33..7bf1344 100644
> --- a/util/compatfd.c
> +++ b/util/compatfd.c
> @@ -71,14 +71,14 @@ static int qemu_signalfd_compat(const sigset_t *mask)
>      QemuThread thread;
>      int fds[2];
>  
> -    info = malloc(sizeof(*info));
> +    info = g_malloc(sizeof(*info));
>      if (info == NULL) {
>          errno = ENOMEM;
>          return -1;
>      }
>  
>      if (pipe(fds) == -1) {
> -        free(info);
> +        g_free(info);
>          return -1;
>      }

Looks good.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-12 10:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-11 20:04 [Qemu-devel] [PATCH] Changed malloc and free to g_malloc and g_free in util/compatfd.c file Prerna Garg
2017-04-12 10:20 ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.