From nobody Mon Feb 9 17:35:20 2026 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 3181D2ED86F for ; Fri, 31 Oct 2025 16:05:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761926750; cv=none; b=Mp1JEeWBqzGFYdCob1xxTkhEtP7HkvZLmR5DAsQEiV3z/CLlSV2giN3JP7CWvyVhPTl4fzVyyqupodDhY8qsMDJWlWPKqRQ59JhdZuKzPaovNRR1jnSoKowm/0SI4Yd1pnBCMXyI6xeOjwmwSro9hGcrDGHTRK2bTIFIUfrnpDo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761926750; c=relaxed/simple; bh=JcnwdY8lRx59kxN7gAwOccPBuzqdGKNApvQA0+Faz40=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qItevAzIDXxFaci65re0+OuOsaOOeH4V13lSaeKEAzBsyRfQy/Ujp0DmnUAsNB3AAq1/ZyaU7W1waMUyol4lF+iOANnOS8glv2ld0NRTTHqXyCTRWK4swoarwEf+KX7U/GMUbBnKrkhiDwFoCRUzJu5jULCedVyAw+EoayEiORs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=oLeN7eW2; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="oLeN7eW2" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 866B21A17B1; Fri, 31 Oct 2025 16:05:47 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 5DE1860704; Fri, 31 Oct 2025 16:05:47 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 9DAD31181806D; Fri, 31 Oct 2025 17:05:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761926746; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=SuE1P/t3JhQxGDqkLTlGxkPzTN+VoYUJlI/OuU0IJZ8=; b=oLeN7eW2SJJheRVLrP64qKAWC1cV4qxKr64rW29/TW1S558J3lK8kKLMwttmvvZEONTmI5 +fyBM+yuoJR86GSSfyZvlQ6f+bf61a/AdB4mT24w97bttq1KUBzZjo4mAphrVOBiO50371 yFmkxmDnI7sJ2xtyvBCScDcDxC3o49p8DC5/qua4SRIMw2VffsLh+70/Iw53I93E8yTboZ R02/3By19voR4nMYm3DLyU5g7uFY7UW97jjroXhYjPnU22FgIm3FohJ1WkRUjirYNEECOJ xzraihbauy/OBWxXAoqJk96+YGURa03c4ijtOfDjK9lQLzJh8OFya6Vxfea4Lw== From: "Bastien Curutchet (Schneider Electric)" Date: Fri, 31 Oct 2025 17:05:39 +0100 Subject: [PATCH net 2/3] net: dsa: microchip: Ensure a ksz_irq is initialized before freeing it 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251031-ksz-fix-v1-2-7e46de999ed1@bootlin.com> References: <20251031-ksz-fix-v1-0-7e46de999ed1@bootlin.com> In-Reply-To: <20251031-ksz-fix-v1-0-7e46de999ed1@bootlin.com> To: Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran Cc: Pascal Eberhard , =?utf-8?q?Miqu=C3=A8l_Raynal?= , Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Bastien Curutchet (Schneider Electric)" X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 Sometimes ksz_irq_free() can be called on uninitialized (or partially initialized) ksz_irq. It leads to freeing uninitialized IRQ numbers and/or domains. Ensure that IRQ numbers or domains are initialized before freeing them. Signed-off-by: Bastien Curutchet (Schneider Electric) --- drivers/net/dsa/microchip/ksz_common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/micro= chip/ksz_common.c index 3a4516d32aa5f99109853ed400e64f8f7e2d8016..4f5e2024442692adefc69d47e82= 381a3c3bda184 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -2858,14 +2858,16 @@ static void ksz_irq_free(struct ksz_irq *kirq) { int irq, virq; =20 - free_irq(kirq->irq_num, kirq); + if (kirq->irq_num) + free_irq(kirq->irq_num, kirq); =20 for (irq =3D 0; irq < kirq->nirqs; irq++) { virq =3D irq_find_mapping(kirq->domain, irq); irq_dispose_mapping(virq); } =20 - irq_domain_remove(kirq->domain); + if (kirq->domain) + irq_domain_remove(kirq->domain); } =20 static irqreturn_t ksz_irq_thread_fn(int irq, void *dev_id) --=20 2.51.0