From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5D3B3515EC for ; Sat, 15 Aug 2026 16:27:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786811246; cv=none; b=mhi0QBjZEI2u0CeCuL0Ygi+heoJXflA6qB+AfSt9VF6w4Yvt13Ntc6396iM3ucBES1laH5H+4U2+VYXLSmkdACG+DeXtZmv0MY4vmeV+qrxDZjpjWKy8RtNJjtNyMwVtHokWPip0q4dUopzWcf8TF+e04987TEVybFs9tlQN+bM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786811246; c=relaxed/simple; bh=Ria57sgjRM6qX6xpXmPX5TAIguxFpNSG6u/CIEFECzY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=liAsz8Hz99kPaemJQcrLs/FY6URh9TYU36TcUwhuBGWXuw4HFwj83v7L0XknwT5B60uHN00EFO7xI3uQ9lqb70I5VvHFQfw5S8DVTIx20oCBjjopYfk9Z3iv4hbdNPY5DyxK4Drv2PHmdhhilDMYLK/mb+tuTiqBzF+ydqLymEc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=m9zEOU8/; arc=none smtp.client-ip=209.85.216.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="m9zEOU8/" Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-38f0f132f56so2653082a91.0 for ; Sat, 15 Aug 2026 09:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786811244; x=1787416044; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/7rlTdXPQx8KtQhzgq3ccigzE8IVB9jSLAgF9XPuDuY=; b=m9zEOU8/cJDlwbeRhJMxYBUNw5pMtryhAkR/2yY+r3P0sCwjCZnLrOsLAemxJPmcp2 EdOcAgSyJ0gA/sQww/U83o7iVwtKA6rcD6YSAtNNuaxwEfkKsJPn83Ic36GCE2IuzcpR 6SYGYdS75yjU9MYcx9oufJvJ+7swHfaas0YMYHTPo/k6O04JyVPjD8pJyZKQpw1bDagR 29fJwzWds43u6Ep+CGcWIpVNjuWSCwAhL3SPO2zRMDrpP7GZn2rcUDdncrCiSQ8+Xmaq QVHHDffCekMw+tLVuj0LgqneisjDBzWAlwg9h8waIYzoE97NP8U0xAaJg8zBvSKKskzE x34g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786811244; x=1787416044; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=/7rlTdXPQx8KtQhzgq3ccigzE8IVB9jSLAgF9XPuDuY=; b=Mpwx3UbFPi5VWAZqVHoZNHRSXmgn20NecjXUh9XgglkaeDyClDigu1xl6lPSOg2And +fVOobFy8R3QzoLQO3Y+k3DjPT/r6CA2fXq/aPQbsTqQr1jwU3zXYPqdGsKMMzfh4+er HojIUro86ncPCj0G7t/qm8qMEd7qTSWNnoQcgJLLiiEBK4qctP9x1DVZd6T9Ang/dRpU nUBSCRtri5QZDDFR3KGJUuDvPcl3+M0BXOn1ZjXZBDDB8AFxqBS5ze/ijCRuAI7eNSXh 6P50L3zMS6eabKDN9Fou9ItWGoothDDtAT/3a6VGiMx1jjZmavFPh7I2DdYLhRT/BPyW B3Xw== X-Forwarded-Encrypted: i=1; AHgh+RruomCuxU7AkJTq/NgYbcOHfZaDHzDUzQkvJr0WR+PziyIOJyB1xPRVOAdhHotQF/2u6BWfUcicwSsGems=@vger.kernel.org X-Gm-Message-State: AOJu0YwcdaWxM+5vnhbjfkpTGIZy0WJg016oRLMOveTw7G+FZCYK6fWT E/mLaxsWXcRKx2jEoMd7GWO17dhCyIuC1OtFSHQ5g8mPAex1YGToKVFq X-Gm-Gg: AR+sD12e+oE4oC4L+p4sLwU/62Ct8vgYqmwUd/uK/AMQp+N59RZgnDmQHbka/efvNNy fYbaxRtdQtJRJ4LOdZzncogt4LDAKXimImMxIIPiG77oUeVYItGCKVx1OVkqvmVgJaF/B9CfATN ejPymGy8N9oYmb5Hix60fhV02yrCiEnOEdSpl2I+iTS5xXewW2vvsay1T+iXMHj5wJ9q5TSZwjr jBFQhR28fgV+BhnrQ2akdfqYDCm4YGw9/cgac9yD3guigAkO6IS72GfjfLqWRDlIY77qFW8vMly aU0EGUbFvCUGLmlMQ3wh0HxIZU//sWGL6GTRF2NJO7ydR3+qq2mbpYdUfUT0X5UanQx2ir88PfB 5EVb5vrdJYZ1LhxekPfkA71RQsVhXXnmHcntiaCq2q5TO5kdaBstSUIBzQxeEjvT9WYTApVLI/o UOJafjXB8PMjw44/O8lD2a0eeXL9UopjhXM4Ls8EuKrvXjUX/J/5NY3nfIVZNYecVs6v45EwXSq NM51tKRQkJSZAx3k0u+Mrw2mkg797DQ X-Received: by 2002:a17:90b:37c3:b0:390:84db:888e with SMTP id 98e67ed59e1d1-3933afb4ba2mr11298200a91.7.1786811244193; Sat, 15 Aug 2026 09:27:24 -0700 (PDT) Received: from Ubuntu.. ([49.43.242.113]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-141387ed5b1sm36427232c88.8.2026.08.15.09.27.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Aug 2026 09:27:23 -0700 (PDT) From: Manish Baing To: perex@perex.cz, tiwai@suse.com, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, claudiu.beznea@tuxon.dev Cc: linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, manishbaing2789@gmail.com, Sashiko AI Subject: [PATCH 1/2] ASoC: sound: atmel: ac97c: Fix IRQ handler null pointer dereference Date: Sat, 15 Aug 2026 16:27:05 +0000 Message-ID: <20260815162707.353893-2-manishbaing2789@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260815162707.353893-1-manishbaing2789@gmail.com> References: <20260815162707.353893-1-manishbaing2789@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In atmel_ac97c_probe(), request_irq() is called before ioremap(). If an interrupt fires immediately, the handler atmel_ac97c_interrupt() will attempt to dereference chip->regs via ac97c_readl(), leading to a null pointer dereference and kernel panic. Move request_irq() to the end of the probe function, after memory is mapped and clocks are enabled, ensuring the hardware is fully ready before interrupts are serviced. Running make W=1 returns no errors. I was unable to test the patch because I do not have the hardware. The issue was flagged by the Sashiko AI bot. Link: https://sashiko.dev/#/patchset/20260530052812.115994-1-manishbaing2789@gmail.com?part=1 Reported-by: Sashiko AI Signed-off-by: Manish Baing --- sound/atmel/ac97c.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c index e394205f469b..205475157e72 100644 --- a/sound/atmel/ac97c.c +++ b/sound/atmel/ac97c.c @@ -733,11 +733,6 @@ static int atmel_ac97c_probe(struct platform_device *pdev) chip = get_chip(card); - retval = request_irq(irq, atmel_ac97c_interrupt, 0, "AC97C", chip); - if (retval) { - dev_dbg(&pdev->dev, "unable to request irq %d\n", irq); - goto err_request_irq; - } chip->irq = irq; spin_lock_init(&chip->lock); @@ -785,6 +780,12 @@ static int atmel_ac97c_probe(struct platform_device *pdev) goto err_ac97_bus; } + retval = request_irq(irq, atmel_ac97c_interrupt, 0, "AC97C", chip); + if (retval) { + dev_dbg(&pdev->dev, "unable to request irq %d\n", irq); + goto err_request_irq; + } + retval = snd_card_register(card); if (retval) { dev_dbg(&pdev->dev, "could not register sound card\n"); -- 2.43.0