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 1672A223DC6; Sat, 30 May 2026 18:12:34 +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=1780164755; cv=none; b=JY/Zs1blX8yP9iw9rb51Ux5UkGWaXDPGHiVcEjego2R3OFOAuNmTtN1lThhbs1uZa3uebSrceBm+OtVuXDhlgwPzpPAcQ+zxSHVy7gnoX51znYQrviP+3Sx89QSbX//fEyw3RVKtug3A4K2llG5tFt5BZXIOiTYG6b3SSnx/4J8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780164755; c=relaxed/simple; bh=P9zrWdTuBgQP94vuZ7aJ5kbwCcO5DCt6o3c4LWH6Elg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qKXzTbQ15LhXvFkNPbcIVxvOzRYHW9Jo/ih1IFVfHB1dfsVB4nh51lwhWVO8VMFAlkrG4zB7GkokcqeE2Sl3uUALbwY1vk4Riv0yQiljqLATIfJvj29bY4wSq8dbi0v3EMapCcLmo/WvuxFDlSvb778IU0SVcUjSVyvWOhiG9co= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WT4U/wsj; 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="WT4U/wsj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B9A51F00893; Sat, 30 May 2026 18:12:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780164754; bh=JaVigBN6cR4cg4GgB6LA+V9i+GhXJeiOi2afmvKVjvI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=WT4U/wsjh6FxFe+FKCCzv9ZvzIU2cXJuiST7YoQQfN5E1jpi61PWoKnSjUYV5HWz8 Fi7kEHrkt19J4qfn7G//KvrAUfTlS7Rv7dbA2d2lpVBOx0zpgSRAxIlb8giVaUw8/u Gk8E7xyCXltJSZ8BDb6M4KXLIScX+aizjmBsI5eQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kohei Enju , Matt Vollrath , Paul Menzel , Aleksandr Loktionov , Sunitha Mekala , Jacob Keller , Jakub Kicinski Subject: [PATCH 5.15 648/776] i40e: Cleanup PTP pins on probe failure Date: Sat, 30 May 2026 18:06:02 +0200 Message-ID: <20260530160256.676801320@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160240.228940103@linuxfoundation.org> References: <20260530160240.228940103@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.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Matt Vollrath commit 678b713ece1e853f11e670a84cb887c35e1381b7 upstream. PTP pin structs are allocated early in probe, but never cleaned up. Fix this by calling i40e_ptp_free_pins in the error path. To support this, i40e_ptp_free_pins is added to the header and pin_config is correctly nullified after being freed. This has been an issue since i40e_ptp_alloc_pins was introduced. Fixes: 1050713026a08 ("i40e: add support for PTP external synchronization clock") Reported-by: Kohei Enju Cc: stable@vger.kernel.org Signed-off-by: Matt Vollrath Reviewed-by: Paul Menzel Reviewed-by: Aleksandr Loktionov Reviewed-by: Kohei Enju Tested-by: Sunitha Mekala Signed-off-by: Jacob Keller Link: https://patch.msgid.link/20260506-jk-iwl-net-2026-05-04-v2-2-a5ea4dc837a9@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/i40e/i40e.h | 1 + drivers/net/ethernet/intel/i40e/i40e_main.c | 1 + drivers/net/ethernet/intel/i40e/i40e_ptp.c | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h @@ -1269,6 +1269,7 @@ void i40e_ptp_restore_hw_time(struct i40 void i40e_ptp_init(struct i40e_pf *pf); void i40e_ptp_stop(struct i40e_pf *pf); int i40e_ptp_alloc_pins(struct i40e_pf *pf); +void i40e_ptp_free_pins(struct i40e_pf *pf); int i40e_update_adq_vsi_queues(struct i40e_vsi *vsi, int vsi_offset); int i40e_is_vsi_uplink_mode_veb(struct i40e_vsi *vsi); int i40e_get_partition_bw_setting(struct i40e_pf *pf); --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -16183,6 +16183,7 @@ err_vsis: i40e_clear_interrupt_scheme(pf); kfree(pf->vsi); err_switch_setup: + i40e_ptp_free_pins(pf); i40e_reset_interrupt_capability(pf); del_timer_sync(&pf->service_timer); err_mac_addr: --- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c @@ -955,12 +955,13 @@ int i40e_ptp_get_ts_config(struct i40e_p * * Release memory allocated for PTP pins. **/ -static void i40e_ptp_free_pins(struct i40e_pf *pf) +void i40e_ptp_free_pins(struct i40e_pf *pf) { if (i40e_is_ptp_pin_dev(&pf->hw)) { kfree(pf->ptp_pins); kfree(pf->ptp_caps.pin_config); pf->ptp_pins = NULL; + pf->ptp_caps.pin_config = NULL; } }