Message ID | 20221206200740.3567551-10-michael@walle.cc (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 16636C352A1 for <linux-arm-kernel@archiver.kernel.org>; Tue, 6 Dec 2022 20:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tGP1SHVTiqMEtwuCoYI+Go3SysPKw3aLwnfgrFvVOYQ=; b=0WrXrNGdigoGS4 +Hq9X6gsuAZDf+pnf5WZ+0fAAoT+3kO7HonGiiH2slZ7hi5S/nHrhkZOwv6x0JHkQM3MiKs4TbOj3 qJmOEz7tTaqbx+ty5ZN7lQntgmCecvWgyQkTadJlGchJK0BdBiKRIthzxdDuq8Q+kUp8VCRAKJEqR cKyrsVL1GLsm7jdNVfzDFONJKPKwGRZdat6+r20l0IuQyxLVaO26tT1vXapVLAXpZXCkraHGTmHA4 h33Dnlrat1oVOsQ19ATpxJUP69OeNyF7UtRsV2wPp7SRgrLKt5vUFOEsIYB/8v2H6VBXHlTXC1cWD PQaD7E+f5ecbytMUS81g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p2eGb-001mo0-1E; Tue, 06 Dec 2022 20:10:13 +0000 Received: from 0001.3ffe.de ([159.69.201.130] helo=mail.3ffe.de) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p2eEk-001k65-QR for linux-arm-kernel@lists.infradead.org; Tue, 06 Dec 2022 20:08:22 +0000 Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id 63FB43B39; Tue, 6 Dec 2022 21:07:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1670357270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mvTkfYS/F5bhxjZrXTlkPXrK+rtGefsDiAak505Ve5I=; b=opmIFnOxHWQg0pmLwLLkrxg6RJTvYGzaJg6JawH8Qi4UGjW5MBsazUYQrHZW/DXBTnn2tq kAPYGcC6FhZA/GYC3fT6VL2tg9SkTyQUXn/FvX95xIzu48RfERGNithitZ5pp6rHYnZ1XO dKF/RGFhhjXQpREAv18gyflhb60KHzTe7t4BHMAxK+mLxNdbn2ZRnt26GDqwf1sDpFtLsM srt8hj2Nkhpz1iUxL3TL42Tqbkc80+eMrCA5o2H+smHMnJbqoXgdshfa4CRdatudLUz6+o IllbFKKUaK3GIj9NbN3MdzDzmU8zmOjQsXEzH4DzumDHh4MAFZ4d/qbTh7axQA== From: Michael Walle <michael@walle.cc> To: Jonathan Corbet <corbet@lwn.net>, Srinivas Kandagatla <srinivas.kandagatla@linaro.org>, Miquel Raynal <miquel.raynal@bootlin.com>, Rob Herring <robh+dt@kernel.org>, Frank Rowand <frowand.list@gmail.com>, Sascha Hauer <s.hauer@pengutronix.de> Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Michael Walle <michael@walle.cc>, Dan Carpenter <error27@gmail.com> Subject: [PATCH v5 09/21] nvmem: core: fix cell removal on error Date: Tue, 6 Dec 2022 21:07:28 +0100 Message-Id: <20221206200740.3567551-10-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221206200740.3567551-1-michael@walle.cc> References: <20221206200740.3567551-1-michael@walle.cc> MIME-Version: 1.0 X-Spam: Yes X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221206_120819_070361_98263BA5 X-CRM114-Status: GOOD ( 11.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
nvmem: core: introduce NVMEM layouts
|
expand
|
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 7c76e0e0072e..70c3d0a20d0d 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -851,7 +851,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) if (config->cells) { rval = nvmem_add_cells(nvmem, config->cells, config->ncells); if (rval) - goto err_teardown_compat; + goto err_remove_cells; } rval = nvmem_add_cells_from_table(nvmem); @@ -868,7 +868,6 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) err_remove_cells: nvmem_device_remove_all_cells(nvmem); -err_teardown_compat: if (config->compat) nvmem_sysfs_remove_compat(nvmem, config); err_device_del:
nvmem_add_cells() could return an error after some cells are already added to the provider. In this case, the added cells are not removed. Remove any registered cells if nvmem_add_cells() fails. Signed-off-by: Michael Walle <michael@walle.cc> --- changes since v4: - new patch drivers/nvmem/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)