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