Initial commit with version 1.2.0-24
[packages/centos6/qemu.git] / 0225-linux-user-Remove-redundant-null-check-and-replace-f.patch
1 From 755055c908ccda2dd9410bb1bde1f3621017fb0c Mon Sep 17 00:00:00 2001
2 From: Stefan Weil <sw@weilnetz.de>
3 Date: Tue, 4 Sep 2012 22:14:19 +0200
4 Subject: [PATCH] linux-user: Remove redundant null check and replace free by
5  g_free
6
7 Report from smatch:
8
9 linux-user/syscall.c:3632 do_ioctl_dm(220) info:
10  redundant null check on big_buf calling free()
11
12 'big_buf' was allocated by g_malloc0, therefore free was also
13 replaced by g_free.
14
15 Signed-off-by: Stefan Weil <sw@weilnetz.de>
16 Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
17 Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
18 (cherry picked from commit ad11ad77748bdd8016370db210751683dc038dd6)
19
20 Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
21 ---
22  linux-user/syscall.c | 4 +---
23  1 file changed, 1 insertion(+), 3 deletions(-)
24
25 diff --git a/linux-user/syscall.c b/linux-user/syscall.c
26 index 6257a04..471d060 100644
27 --- a/linux-user/syscall.c
28 +++ b/linux-user/syscall.c
29 @@ -3628,9 +3628,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd,
30          unlock_user(argptr, arg, target_size);
31      }
32  out:
33 -    if (big_buf) {
34 -        free(big_buf);
35 -    }
36 +    g_free(big_buf);
37      return ret;
38  }
39  
40 -- 
41 1.7.12.1
42