Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B901C6FD1D for ; Tue, 7 Mar 2023 17:11:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229958AbjCGRL3 (ORCPT ); Tue, 7 Mar 2023 12:11:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229870AbjCGRLF (ORCPT ); Tue, 7 Mar 2023 12:11:05 -0500 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFA0B9CFF5; Tue, 7 Mar 2023 09:05:49 -0800 (PST) Received: from 3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) (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 EB091124; Tue, 7 Mar 2023 18:04:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1678208678; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MnPC/dx2pZinfk0Ola2wbvkMss8Crat96y40veuYQjU=; b=lEq+23SJ1QPwyEFqQkXp1Prs1SVNz2226k8aboOabP0a4S59Ky5JMD44yE7pHdaL7DfsHy b4P28jnpujI6a/Ix+sT/zQ8CqOClQyzGwAoucxKFhIvgk9PzC03FaSCKiBK6w7eOhgPRDD P3em48gt3vhbqlX0U24/RuOKTxkBp2f8UikmJhrdZp/MTCh3Rdj/e7V6zRM0kfpqkycxDF ohm+n33XaGaLG9FPha0HZboLLazgNZLOdldf2/5ZfhSssrVlWA7Jx1SQxqDbZ+IKurSK00 ftd4sNGMPns4kyYZB0q9jHLe8DwofBv0fgEHi6/JCyQISxY/yJHwNyzLIyDSvw== MIME-Version: 1.0 Date: Tue, 07 Mar 2023 18:04:37 +0100 From: Michael Walle To: Miquel Raynal Cc: Srinivas Kandagatla , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , =?UTF-8?Q?Rafa=C5=82_Mi=C5=82ecki?= , Robert Marko , Luka Perkov , Thomas Petazzoni , Rob Herring , Frank Rowand , devicetree@vger.kernel.org, Alexander Stein Subject: Re: [PATCH v2 09/21] nvmem: core: return -ENOENT if nvmem cell is not found In-Reply-To: <20230307165359.225361-10-miquel.raynal@bootlin.com> References: <20230307165359.225361-1-miquel.raynal@bootlin.com> <20230307165359.225361-10-miquel.raynal@bootlin.com> User-Agent: Roundcube Webmail/1.4.13 Message-ID: X-Sender: michael@walle.cc Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 2023-03-07 17:53, schrieb Miquel Raynal: > From: Michael Walle > > Prior to commit 3cb05fdbaed6 ("nvmem: core: add an index parameter to > the cell") of_nvmem_cell_get() would return -ENOENT if the cell wasn't > found. Particularly, if of_property_match_string() returned -EINVAL, > that return code was passed as the index to of_parse_phandle(), which > then detected it as invalid and returned NULL. That led to an return > code of -ENOENT. > > With the new code, the negative index will lead to an -EINVAL of > of_parse_phandle_with_optional_args() which pass straight to the > caller and break those who expect an -ENOENT. > > Fix it by always returning -ENOENT. > > Fixes: efff2655ab0f ("nvmem: core: add an index parameter to the cell") > Reported-by: Alexander Stein > Signed-off-by: Michael Walle > Signed-off-by: Miquel Raynal Misses the Tested-by: Alexander Stein tag. But.. this is already applied anyways: https://lore.kernel.org/r/515d5fed-2083-c1fd-eea5-148d9e1c45bd@linaro.org/ -michael