[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/14] linux-user: Remove redundant null check and r
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH 12/14] linux-user: Remove redundant null check and replace free by g_free |
Date: |
Sun, 23 Sep 2012 11:00:18 +0100 |
From: Stefan Weil <address@hidden>
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>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Stefan Hajnoczi <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 6257a04..471d060 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;
}
--
1.7.10.4
- [Qemu-devel] [PATCH 02/14] qemu-ga: Remove unreachable code after g_error, (continued)
- [Qemu-devel] [PATCH 02/14] qemu-ga: Remove unreachable code after g_error, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 04/14] cadence_uart: Fix buffer overflow, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 05/14] lm4549: Fix buffer overflow, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 07/14] pflash_cfi01: Fix warning caused by unreachable code, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 06/14] ioh3420: Remove unreachable code, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 08/14] dtrace backend: add function to reserved words, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 09/14] curses: don't initialize curses when qemu is daemonized, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 10/14] TextConsole: saturate escape parameter in TTY_STATE_CSI, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 11/14] qemu-timer: simplify qemu_run_timers, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 13/14] net/socket: Fix compiler warning (regression for MinGW), Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 12/14] linux-user: Remove redundant null check and replace free by g_free,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 14/14] w32: Always use standard instead of native format strings, Stefan Hajnoczi, 2012/09/23
- Re: [Qemu-devel] [PULL 00/14] Trivial patches for 15 to 23 September 2012, Anthony Liguori, 2012/09/25