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: 15d024d4aa
("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>
This commit is contained in:
parent
2132cfe52b
commit
832a59e43b
@ -358,17 +358,12 @@ static void nvme_ns_realize(DeviceState *dev, Error **errp)
|
|||||||
NvmeNamespace *ns = NVME_NS(dev);
|
NvmeNamespace *ns = NVME_NS(dev);
|
||||||
BusState *s = qdev_get_parent_bus(dev);
|
BusState *s = qdev_get_parent_bus(dev);
|
||||||
NvmeCtrl *n = NVME(s->parent);
|
NvmeCtrl *n = NVME(s->parent);
|
||||||
Error *local_err = NULL;
|
|
||||||
|
|
||||||
if (nvme_ns_setup(ns, &local_err)) {
|
if (nvme_ns_setup(ns, errp)) {
|
||||||
error_propagate_prepend(errp, local_err,
|
|
||||||
"could not setup namespace: ");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nvme_register_namespace(n, ns, errp)) {
|
if (nvme_register_namespace(n, ns, errp)) {
|
||||||
error_propagate_prepend(errp, local_err,
|
|
||||||
"could not register namespace: ");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user