From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 E417F442131; Thu, 30 Jul 2026 15:06:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785423988; cv=none; b=aDq6bnjtDulLGbr/EKfZJEl5fiGe0Q/JIPfwfIRiidfr5q2BOqFsAe5yjUdkuY7WLov4wDpA7s/hXume0XUg+3DxBAS9dz3+REn/AvkhPw7LnethaHfvqWXONebGYvgAE/JmKS6xTrQw6UBPzYhgnYnYMY90hctcoF0I7VTtqb8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785423988; c=relaxed/simple; bh=UTll2o1Qul/OOxgpvMp/aLUdYXd1nHiol8QX5zUGrpw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FjOnuJaRUCWv//Bg3M7KqbKzsoUtuMkevxf3qShKAcMUC7DDHJ+t7dE9WDdnMkg6dthF4ewLcLj680Due4U2AOohxoa0AqxUy+a3V3c6/WTJYpkmVlq36t7yq8up7WguVg2nZ9mSyD5n5t7kOr8f8nnsCkTVvp6wHiWHmfemHj4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QhVx5fbC; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="QhVx5fbC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A93D1F000E9; Thu, 30 Jul 2026 15:06:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785423987; bh=hB0/pIacmFGWl43sMDh6g3wu9I/X1oHixWvGoaigSnM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QhVx5fbC1WpZ9oTW0Je1CvI5KqM3Dxk0E8rmyjsIYVfAAuK+3AURuFmiKxOmtVboi ZB6utaKkpecsh7gWhNUq52dkj9Ra3cQXMKpbWXCd9pGj2CsgX1FjmU9DFOmczbDjL8 wLDMQq7tuj12ER0jmFEjxO1DgWysg6BRqrdR3F/o= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guangshuo Li , Simon Horman , Paolo Abeni , Sasha Levin Subject: [PATCH 6.18 219/675] dpaa2-switch: put MAC endpoint device on disconnect Date: Thu, 30 Jul 2026 16:09:09 +0200 Message-ID: <20260730141449.797874169@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730141445.110192266@linuxfoundation.org> References: <20260730141445.110192266@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 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Guangshuo Li [ Upstream commit 4c1eabbef7a1707635652e956e39db1269c3af2b ] fsl_mc_get_endpoint() returns the MAC endpoint device with a reference taken through device_find_child(). The switch port connect path stores that device in mac->mc_dev and keeps it for the lifetime of the connected MAC object. However, the disconnect path only closes the MAC and frees the dpaa2_mac object. It does not drop the endpoint device reference stored in mac->mc_dev, so every successful connect leaks that device reference when the MAC is later disconnected. Drop the endpoint device reference before freeing the dpaa2_mac object. Fixes: 84cba72956fd ("dpaa2-switch: integrate the MAC endpoint support") Signed-off-by: Guangshuo Li Reviewed-by: Simon Horman Link: https://patch.msgid.link/20260708111025.749311-1-lgs201920130244@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index 789a46f6938eea..846300b77e8acc 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -1511,6 +1511,7 @@ static void dpaa2_switch_port_disconnect_mac(struct ethsw_port_priv *port_priv) dpaa2_mac_disconnect(mac); dpaa2_mac_close(mac); + put_device(&mac->mc_dev->dev); kfree(mac); } -- 2.53.0