aboutsummaryrefslogtreecommitdiff
path: root/hw/block-common.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2013-01-22 11:07:57 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2013-01-30 11:14:46 +0100
commitc64f50d1e250879611e6f328e2c4fb18c8a4ab0c (patch)
tree93e1a5b9279becfec8eba4477924cfa67a1f89b0 /hw/block-common.c
parent6528499fa4c3ceaec01ad29d8090ef55918ebfb3 (diff)
g_strdup(NULL) returns NULL; simplify
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/block-common.c')
-rw-r--r--hw/block-common.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/hw/block-common.c b/hw/block-common.c
index 0f1b64ec95..d21ec3ada1 100644
--- a/hw/block-common.c
+++ b/hw/block-common.c
@@ -18,9 +18,7 @@ void blkconf_serial(BlockConf *conf, char **serial)
if (!*serial) {
/* try to fall back to value set with legacy -drive serial=... */
dinfo = drive_get_by_blockdev(conf->bs);
- if (dinfo->serial) {
- *serial = g_strdup(dinfo->serial);
- }
+ *serial = g_strdup(dinfo->serial);
}
}