From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE4AC1E501; Thu, 13 Jun 2024 12:33:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718281989; cv=none; b=RBpKFKdVXlZpOODkyW1cvHoom1cBc4GjkGUXR8uNOHqnV1XM2IAey0tJrSk3SY8LGTTSNHX2mHGbC+gbcc/oJpuxLnDNChNl1j5JH5QHvT1A8t/FbxQLbUcDWJeeFem0hqrh3TA3iWRwmuUp3s44Jy6h/nhMS2YHYtx/hCIAx+Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718281989; c=relaxed/simple; bh=yWGErCZqNuy4FX2oZ2BjHjP/ouzNmeGNuLO1txrRPTw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iwOyESi3AeubeudAiNVCI0SO1OmXQ2qJNVvEtGPLVk/qpiwy1FYrCG/LgZLaYCMZZo/WmlYYiDoose1QY7RqEQiLw32DXQDBulvenYHx2bO3BjdWY68s4CHD0PptnBzxa9bh8OzXinyXTAzuGhiEWpL/GkxGrKoe4fEiHIZYuQA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=B2tJrJVY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="B2tJrJVY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62972C2BBFC; Thu, 13 Jun 2024 12:33:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718281988; bh=yWGErCZqNuy4FX2oZ2BjHjP/ouzNmeGNuLO1txrRPTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B2tJrJVYmgMt4Gf6z5cZ0LaSc/m1Aakly+j69WlHQoeXSZ/bVS9+SCV7oo8Ls/b9P s2eCYEjzl90ECsXFj//ZHmZhrddhUAdALWndzcJUuyLOjdRQt/QhkaqT+d9ylPOZmk CRvsxYnlXy5dGw8WrtgWnXMXfnSZoeNJDr2eMk/o= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Aapo Vienamo , Mika Westerberg , Michael Walle , Miquel Raynal , Sasha Levin Subject: [PATCH 5.15 125/402] mtd: core: Report error if first mtd_otp_size() call fails in mtd_otp_nvmem_add() Date: Thu, 13 Jun 2024 13:31:22 +0200 Message-ID: <20240613113307.017807297@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240613113302.116811394@linuxfoundation.org> References: <20240613113302.116811394@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Aapo Vienamo [ Upstream commit d44f0bbbd8d182debcce88bda55b05269f3d33d6 ] Jump to the error reporting code in mtd_otp_nvmem_add() if the mtd_otp_size() call fails. Without this fix, the error is not logged. Signed-off-by: Aapo Vienamo Reviewed-by: Mika Westerberg Reviewed-by: Michael Walle Fixes: 4b361cfa8624 ("mtd: core: add OTP nvmem provider support") Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20240313173425.1325790-2-aapo.vienamo@linux.intel.com Signed-off-by: Sasha Levin --- drivers/mtd/mtdcore.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 2a228ee32641c..16077e5a2df1c 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -886,8 +886,10 @@ static int mtd_otp_nvmem_add(struct mtd_info *mtd) if (mtd->_get_user_prot_info && mtd->_read_user_prot_reg) { size = mtd_otp_size(mtd, true); - if (size < 0) - return size; + if (size < 0) { + err = size; + goto err; + } if (size > 0) { nvmem = mtd_otp_nvmem_register(mtd, "user-otp", size, -- 2.43.0