yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
05bba0
From 348879493233388280a097c75f5a371512d7918b Mon Sep 17 00:00:00 2001
05bba0
From: Richard Jones <rjones@redhat.com>
05bba0
Date: Thu, 11 Jun 2015 11:40:23 +0200
05bba0
Subject: [PATCH 23/30] block: Drop superfluous conditionals around g_free()
05bba0
05bba0
Message-id: <1434022828-13037-17-git-send-email-rjones@redhat.com>
05bba0
Patchwork-id: 65853
05bba0
O-Subject: [RHEL-7.2 qemu-kvm v3 PATCH 16/21] block: Drop superfluous conditionals around g_free()
05bba0
Bugzilla: 1226684
05bba0
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
05bba0
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
05bba0
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
05bba0
05bba0
From: Markus Armbruster <armbru@redhat.com>
05bba0
05bba0
Signed-off-by: Markus Armbruster <armbru@redhat.com>
05bba0
Reviewed-by: Eric Blake <eblake@redhat.com>
05bba0
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
05bba0
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
05bba0
05bba0
Upstream-status: f7047c2daf760385edf83df10be4259bea190e75
05bba0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
05bba0
---
05bba0
 block/curl.c       | 3 +--
05bba0
 block/iscsi.c      | 4 +---
05bba0
 hw/block/onenand.c | 4 +---
05bba0
 3 files changed, 3 insertions(+), 8 deletions(-)
05bba0
05bba0
diff --git a/block/curl.c b/block/curl.c
05bba0
index e48cc87..d95789a 100644
05bba0
--- a/block/curl.c
05bba0
+++ b/block/curl.c
05bba0
@@ -614,8 +614,7 @@ static void curl_readv_bh_cb(void *p)
05bba0
     acb->end = (acb->nb_sectors * SECTOR_SIZE);
05bba0
 
05bba0
     state->buf_off = 0;
05bba0
-    if (state->orig_buf)
05bba0
-        g_free(state->orig_buf);
05bba0
+    g_free(state->orig_buf);
05bba0
     state->buf_start = start;
05bba0
     state->buf_len = acb->end + s->readahead_size;
05bba0
     end = MIN(start + state->buf_len, s->len) - 1;
05bba0
diff --git a/block/iscsi.c b/block/iscsi.c
05bba0
index 2a4ab22..92dc1dd 100644
05bba0
--- a/block/iscsi.c
05bba0
+++ b/block/iscsi.c
05bba0
@@ -1516,9 +1516,7 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
05bba0
 
05bba0
 out:
05bba0
     qemu_opts_del(opts);
05bba0
-    if (initiator_name != NULL) {
05bba0
-        g_free(initiator_name);
05bba0
-    }
05bba0
+    g_free(initiator_name);
05bba0
     if (iscsi_url != NULL) {
05bba0
         iscsi_destroy_url(iscsi_url);
05bba0
     }
05bba0
diff --git a/hw/block/onenand.c b/hw/block/onenand.c
05bba0
index 8b511a7..55768ec 100644
05bba0
--- a/hw/block/onenand.c
05bba0
+++ b/hw/block/onenand.c
05bba0
@@ -329,9 +329,7 @@ static inline int onenand_prog_spare(OneNANDState *s, int sec, int secn,
05bba0
                                     dp, 1) < 0;
05bba0
             }
05bba0
         }
05bba0
-        if (dp) {
05bba0
-            g_free(dp);
05bba0
-        }
05bba0
+        g_free(dp);
05bba0
     }
05bba0
     return result;
05bba0
 }
05bba0
-- 
05bba0
1.8.3.1
05bba0