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 23FC9329C73; Mon, 27 Oct 2025 18:55:25 +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=1761591325; cv=none; b=git6YOd9KCwEcsgbru5OAboiLZGGEFBlPrcQx2O3r10chckK/l5BdHHFl1Mw9fOP131Kx0cY2K1e6rmLxWoL7nYPe7s1HumHdgOW82gkTih7R0ugprjoma325DSMMz1s+5IV2wIwPqopaEHHEy4YvXtrBErjws9LhNrg1BcaeLg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761591325; c=relaxed/simple; bh=G4HG2SCMgr6tcWa5fHtGJK+nB6qdaH10lJUk4xwtjKk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oqAOguO++BE3U2jV2irujHCty3LD/WoVjpsv8URdNgsLhEXy1FliLfL6Bv3GsYrX0TJFNl6ox+5PQV9mOncIvUTVYtmBtFNAlm+ge8BGAftqkSb5XV4djz8Nfh5BXqJHXb8lWOvb5D1kqyKjE2GvVJhRll5T9kmX3QAB4JYl51I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FMqvnvED; 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="FMqvnvED" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA684C116B1; Mon, 27 Oct 2025 18:55:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1761591325; bh=G4HG2SCMgr6tcWa5fHtGJK+nB6qdaH10lJUk4xwtjKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FMqvnvEDlTq8+nodgqfN3dw6/1QdLaFcFnrvDvpWWJwWZxr32VPhUINyp/U0tGgha LUJVo79UTNmgZMe/RhLUUgC2fo6h0kKAOcME6QRgIFvL+InHmEnTikVITIwJVu21qr AWcrB21snbuB1P4dbR6iYzLAxwUbZyOo817ZFNlk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Harini T , Peng Fan , Jassi Brar , Sasha Levin Subject: [PATCH 5.10 117/332] mailbox: zynqmp-ipi: Remove dev.parent check in zynqmp_ipi_free_mboxes Date: Mon, 27 Oct 2025 19:32:50 +0100 Message-ID: <20251027183527.704410930@linuxfoundation.org> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251027183524.611456697@linuxfoundation.org> References: <20251027183524.611456697@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Harini T [ Upstream commit 019e3f4550fc7d319a7fd03eff487255f8e8aecd ] The ipi_mbox->dev.parent check is unreliable proxy for registration status as it fails to protect against probe failures that occur after the parent is assigned but before device_register() completes. device_is_registered() is the canonical and robust method to verify the registration status. Remove ipi_mbox->dev.parent check in zynqmp_ipi_free_mboxes(). Fixes: 4981b82ba2ff ("mailbox: ZynqMP IPI mailbox controller") Signed-off-by: Harini T Reviewed-by: Peng Fan Signed-off-by: Jassi Brar Signed-off-by: Sasha Levin --- drivers/mailbox/zynqmp-ipi-mailbox.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mailbox/zynqmp-ipi-mailbox.c b/drivers/mailbox/zynqmp-ipi-mailbox.c index 136c1f67dd223..e64f7157f065f 100644 --- a/drivers/mailbox/zynqmp-ipi-mailbox.c +++ b/drivers/mailbox/zynqmp-ipi-mailbox.c @@ -618,10 +618,8 @@ static void zynqmp_ipi_free_mboxes(struct zynqmp_ipi_pdata *pdata) i = pdata->num_mboxes; for (; i >= 0; i--) { ipi_mbox = &pdata->ipi_mboxes[i]; - if (ipi_mbox->dev.parent) { - if (device_is_registered(&ipi_mbox->dev)) - device_unregister(&ipi_mbox->dev); - } + if (device_is_registered(&ipi_mbox->dev)) + device_unregister(&ipi_mbox->dev); } } -- 2.51.0