From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) (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 C6B6B30D40D for ; Wed, 12 Aug 2026 06:21:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.201.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786515707; cv=none; b=clLScOvsD2nm4Zr7j1agEO9MVgu/3BsQ0IIKtLjKUsBzjXzHXw4SiOE1OdlAsDYUcANkHge2hIOJngboYmc0Uhj7KztSFEJbn61kSa3pp/Y7T/SxOG+PBOUlnINpTrYvWNhOnrbgI/HTHO7FyKKFnnnIAntvZ9QTqDQLgtaAT5E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786515707; c=relaxed/simple; bh=6y4jiyr64iBnTq++ei7NhnbvPoSO/55GC3Dnrlv8yZ4=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:From:To:Subject: References:In-Reply-To; b=AEW1G36FouDVy60Oe3+rEf5klP4URifQvpDOUczfJz3zsGRlQ9CSSz+V9e9bVwxYGiBW2ljA4g7wqFOv5e4BEnLT2Vz5XA89w38kX6+sxLNB/OgyMKgGFqnkz0PkX8IqVpMvbNYYAoZrIwEousiH0loYY36WskUOJ0Pibw/jO/4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=walle.cc; arc=none smtp.client-ip=159.69.201.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=walle.cc Received: from localhost (unknown [IPv6:2a02:810b:4320:1000:4685:ff:fe12:5967]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 442EC141; Wed, 12 Aug 2026 08:21:43 +0200 (CEST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 12 Aug 2026 08:21:42 +0200 Message-Id: Cc: From: "Michael Walle" To: "Leo Cheng" , "Srinivas Kandagatla" , "Miquel Raynal" Subject: Re: [PATCH 1/2] nvmem: layouts: sl28vpd: fix device_node reference leak in error path X-Mailer: aerc 0.20.0 References: In-Reply-To: On Tue Aug 11, 2026 at 2:55 PM CEST, Leo Cheng wrote: > sl28vpd_add_cells() takes a reference on the child node via > of_get_child_by_name() for each entry and passes it to > nvmem_add_one_cell() as info.np. On success the created cell entry > adopts that reference and releases it later via of_node_put() when the > entry is torn down; nvmem_add_one_cell() does not take its own > reference. On failure it does not consume the reference either, so the > caller still owns it, but the error path only puts layout_np before > returning, leaking the child node reference. > > Put info.np on the error path as well. of_node_put(NULL) is a no-op, so > this is safe even when of_get_child_by_name() returned NULL. > > Fixes: d9fae023fe86 ("nvmem: layouts: sl28vpd: Add new layout driver") > Signed-off-by: Leo Cheng Reviewed-by: Michael Walle