Merge "QEMU update with VENOM (CVE-2015-3456) patch" into 5.0.2
[packages/centos6/qemu.git] / 0235-Clear-handler-only-for-valid-fd.patch
1 From b7b94b6016b89bf698d661ce4fd22139e771a835 Mon Sep 17 00:00:00 2001
2 From: Orit Wasserman <owasserm@redhat.com>
3 Date: Mon, 24 Sep 2012 13:11:10 +0200
4 Subject: [PATCH] Clear handler only for valid fd
5
6 Signed-off-by: Orit Wasserman <owasserm@redhat.com>
7 Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
8 (cherry picked from commit 3202becaa2b805497ce9e6faa6edfb83665f91b1)
9
10 Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
11 ---
12  migration.c | 4 +++-
13  1 file changed, 3 insertions(+), 1 deletion(-)
14
15 diff --git a/migration.c b/migration.c
16 index 1edeec5..22a05c4 100644
17 --- a/migration.c
18 +++ b/migration.c
19 @@ -240,7 +240,9 @@ static int migrate_fd_cleanup(MigrationState *s)
20  {
21      int ret = 0;
22  
23 -    qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);
24 +    if (s->fd != -1) {
25 +        qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);
26 +    }
27  
28      if (s->file) {
29          DPRINTF("closing file\n");
30 -- 
31 1.7.12.1
32