From patchwork Thu Feb 11 15:21:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Jensen X-Patchwork-Id: 12083531 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 248E0C433E0 for ; Thu, 11 Feb 2021 15:33:59 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B3A5E64DE2 for ; Thu, 11 Feb 2021 15:33:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3A5E64DE2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=irrelevant.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:51388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lADyf-0003ZU-GQ for qemu-devel@archiver.kernel.org; Thu, 11 Feb 2021 10:33:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lADmv-0003cI-6Z; Thu, 11 Feb 2021 10:21:49 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:53103) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lADmt-0003k7-Nf; Thu, 11 Feb 2021 10:21:48 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id EE6E15C00A4; Thu, 11 Feb 2021 10:21:46 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Thu, 11 Feb 2021 10:21:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=/qiaKh/Umj0v0 u+CwNpOqgCztOzHKADBAylv/jX6NO0=; b=KSwWcyF+VeaZ1APqiVZtM7rLL1pF4 hQRF0AUYApY6hmCUYhNxfHFUPkMSWj+mowiensG8QiQ/seAHhRJgEp5pf1gn+a6o 2ycKBKHn48e1SDq51c4uqdlI1XfxjVGLMXXJ3dyImsPyBatm+qLQoEizUasccFIJ FegsfIjJF/XgahTjQj4pWX+Y97RkWtWxQUj2kwdE9t252z3bXDB2mRMstiYhnOv/ 0tAV1P0ZfErQBUuc5Nc0Td6W5FlNGZnLnnastZbPAn3QocRWzLv9Xar4Wac2IS+Y t+KcpwoR+1AlFPmJ32SxhpZfJN/Xp85xWznzSYcVD9mm7oCy/aUn19sLA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=/qiaKh/Umj0v0u+CwNpOqgCztOzHKADBAylv/jX6NO0=; b=iq8nCxv6 qXWksR/9bEzL+yXKXBifIUrHnT9O+Q1skbW0r89cDfMYn+DYLe1RHNHl1PVXq9Z1 +9S9KOHrgvtE+aQxwO6JlpiWTqhinOMc8yoTfoGjJLoFt0bptFm5L5UiOeiSEjLj 6+NX/fFlQA1gphrEHXmKlhsazvD2FkmMU335lR3s9mO4A+MZTlDSCF2WKmnrAwo+ ldKS/PTcVY1TGJKJHYkiFWiw/JvoE4zOFfe1qlBXKPdtZ/WQrmpkH2pDv/R5wKyj 0EeAEol1yK8veDSBg6Xhpj08ffJ7euPfS25uPrBVmPwRafuzo1JCIQCxUYE/hDhC k1613lCsT2uHNg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrheelgdejgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepmfhlrghushcu lfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrthhtvg hrnhepueelteegieeuhffgkeefgfevjeeigfetkeeitdfgtdeifefhtdfhfeeuffevgfek necukfhppeektddrudeijedrleekrdduledtnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepihhtshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: Received: from apples.local (80-167-98-190-cable.dk.customer.tdc.net [80.167.98.190]) by mail.messagingengine.com (Postfix) with ESMTPA id 6DBFA240062; Thu, 11 Feb 2021 10:21:45 -0500 (EST) From: Klaus Jensen To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL v2 3/3] hw/block/nvme: fix error handling in nvme_ns_realize Date: Thu, 11 Feb 2021 16:21:39 +0100 Message-Id: <20210211152139.1004257-4-its@irrelevant.dk> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210211152139.1004257-1-its@irrelevant.dk> References: <20210211152139.1004257-1-its@irrelevant.dk> MIME-Version: 1.0 Received-SPF: pass client-ip=66.111.4.27; envelope-from=its@irrelevant.dk; helo=out3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Klaus Jensen , Max Reitz , Keith Busch , Minwoo Im , Klaus Jensen Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Klaus Jensen 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 Reviewed-by: Minwoo Im Signed-off-by: Klaus Jensen --- hw/block/nvme-ns.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c index dfed71a950fa..93ac6e107a09 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; }