diff options
author | Klaus Jensen <k.jensen@samsung.com> | 2021-02-11 14:03:59 +0100 |
---|---|---|
committer | Klaus Jensen <k.jensen@samsung.com> | 2021-02-11 14:23:08 +0100 |
commit | 832a59e43b5d8b8a9c2b2565008ebea1059d539d (patch) | |
tree | 7741765af2d5b9ac0d2a1a1c9c0d33e81ac09a0e | |
parent | 2132cfe52bd87f191887c1728190bf56e8d5275f (diff) | |
download | qemu-832a59e43b5d8b8a9c2b2565008ebea1059d539d.zip qemu-832a59e43b5d8b8a9c2b2565008ebea1059d539d.tar.gz qemu-832a59e43b5d8b8a9c2b2565008ebea1059d539d.tar.bz2 |
hw/block/nvme: fix error handling in nvme_ns_realize
nvme_ns_realize passes errp to nvme_register_namespaces, but then try to
prepend errp with local_err.
Just remove the local_err and use errp directly.
Fixes: 15d024d4aa9b ("hw/block/nvme: split setup and register for namespace")
Cc: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
-rw-r--r-- | hw/block/nvme-ns.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c index dfed71a..93ac6e1 100644 --- a/hw/block/nvme-ns.c +++ b/hw/block/nvme-ns.c @@ -358,17 +358,12 @@ static void nvme_ns_realize(DeviceState *dev, Error **errp) NvmeNamespace *ns = NVME_NS(dev); BusState *s = qdev_get_parent_bus(dev); NvmeCtrl *n = NVME(s->parent); - Error *local_err = NULL; - if (nvme_ns_setup(ns, &local_err)) { - error_propagate_prepend(errp, local_err, - "could not setup namespace: "); + if (nvme_ns_setup(ns, errp)) { return; } if (nvme_register_namespace(n, ns, errp)) { - error_propagate_prepend(errp, local_err, - "could not register namespace: "); return; } |