qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] linux-user: Remove redundant null check and rep


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH] linux-user: Remove redundant null check and replace free by g_free
Date: Sat, 22 Sep 2012 23:28:43 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20120724 Iceowl/1.0b1 Icedove/3.0.11

Am 04.09.2012 22:14, schrieb Stefan Weil:
Report from smatch:

linux-user/syscall.c:3632 do_ioctl_dm(220) info:
  redundant null check on big_buf calling free()

'big_buf' was allocated by g_malloc0, therefore free was also
replaced by g_free.

Signed-off-by: Stefan Weil<address@hidden>
---
  linux-user/syscall.c |    4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1513f08..c3533da 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3628,9 +3628,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t 
*buf_temp, int fd,
          unlock_user(argptr, arg, target_size);
      }
  out:
-    if (big_buf) {
-        free(big_buf);
-    }
+    g_free(big_buf);
      return ret;
  }


Ping? Maybe qemu-trivial can take that patch, it's trivial enough.
Peter reviewed it, see http://patchwork.ozlabs.org/patch/181669/.

Regards

Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]