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 C2E513C9453 for ; Thu, 9 Apr 2026 14:26:01 +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=1775744761; cv=none; b=pf+v4+naCDE4fXckFbV8hv6F+rTRakqi/mbvYRCQXpRL8MrZZFxc1rvacelm0il+W6ETbjjdEVj0LSXoEK5NRmsKaVpR0w/tUEfYgaAEarVpJFqzPzdT3kQF9tIiwompvBUYzu43wgWc704SxgaV8hgIQ+w4IMlKHT/1Sz8Phlw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775744761; c=relaxed/simple; bh=fu+LIzuUi5owsNa6jgIR1Y2IJXiqfxhvVZVLMHNlvzg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rIhnRS1KyNXX44aawmZAbXrpypGxvzwpfcLMqdh007+7sQUkQP7RHf+KXmOucNfKKreUBGHkWyUE1YQj6dT4B2EkY/g9hq+qlRjF16hKRYrVTPyzfgjtUKzGJzqRfdEfu2muTDORlO+GD/h3VAQ45fOsIURNRNBJ4y2RrAWIwyk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AyOQ2Ned; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AyOQ2Ned" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0B25C4CEF7; Thu, 9 Apr 2026 14:25:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775744761; bh=fu+LIzuUi5owsNa6jgIR1Y2IJXiqfxhvVZVLMHNlvzg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AyOQ2NedlinVaantTOIWp8Mbve3ID4oXOIpjPPLyzN8e9mYyxAx+aND1P7Va31kC5 l7CNesPCXFHnVMyvRwV0lYPoJl3gdQuBpGZIRXG2NCgT62eQuF9NkK72rDMQAUBrIq i+dpZCmEeSgu5exbmRjV5nCCsWY3mWtT8Wdaywa+x/tX67bl/kuqg+BpApFljIYpAb hexJ54xSDFSPBtrh4UIr6MUgzWj9XCed2mgh34JZilViP6jLAfi8ieWZEB037RKqQX 7wuyjFpF7flx11azbTJ63ioEUUirWYVTJnykqa0SfqA6hhdaeIjLviKXG4RFYxfANy rxfNOl66xintQ== Date: Thu, 9 Apr 2026 17:25:55 +0300 From: Mike Rapoport To: Breno Leitao Cc: Alexander Graf , Pasha Tatashin , Pratyush Yadav , kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH] kho: fix error handling in kho_add_subtree() Message-ID: References: <20260407-kho_fix_send-v1-1-b21977feb960@debian.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260407-kho_fix_send-v1-1-b21977feb960@debian.org> On Tue, Apr 07, 2026 at 10:01:47AM -0700, Breno Leitao wrote: > Fix two error handling issues in kho_add_subtree(), where it doesn't > handle the error path correctly. > > 1. If fdt_setprop() fails after the subnode has been created, the > subnode is not removed. This leaves an incomplete node in the FDT > (missing "preserved-data" or "blob-size" properties). > > 2. The fdt_setprop() return value (an FDT error code) is stored > directly in err and returned to the caller, which expects -errno. > > Fix both by storing fdt_setprop() results in fdt_err, jumping to a new > out_del_node label that removes the subnode on failure, and only setting > err = 0 on the success path, otherwise returning -ENOMEM (instead of > FDT_ERR_ errors that would come from fdt_setprop). > > Fixes: 3dc92c311498 ("kexec: add Kexec HandOver (KHO) generation helpers") > Suggested-by: Pratyush Yadav > Signed-off-by: Breno Leitao Reviewed-by: Mike Rapoport (Microsoft) > --- > kernel/liveupdate/kexec_handover.c | 21 +++++++++++++-------- > 1 file changed, 13 insertions(+), 8 deletions(-) -- Sincerely yours, Mike.