]> git.proxmox.com Git - mirror_qemu.git/commitdiff
linux-user: Remove redundant null check and replace free by g_free
authorStefan Weil <sw@weilnetz.de>
Tue, 4 Sep 2012 20:14:19 +0000 (22:14 +0200)
committerStefan Hajnoczi <stefanha@gmail.com>
Sun, 23 Sep 2012 06:35:29 +0000 (07:35 +0100)
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 <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
linux-user/syscall.c

index 6257a04d0a95f7b23fd2bc707bf11ee03d52b42f..471d0605f7a5b8ba2471a6a6678986d5a01194e0 100644 (file)
@@ -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;
 }