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 0112C2AD04; Tue, 26 Aug 2025 13:38:26 +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=1756215507; cv=none; b=J0aAq1vPoMttGoIBRFmH1WXFJCNo5DQMumG3L3SoTJfps1UaZQdkOX54ky7rcIF3YI/jLR8dCxbvfsAsQFR7RzYKBy4K7um86s88QJ0n/62sXdAIGBUFOIqLPYOkzsL4suLe+G1mPxZI0r7+nhFoiRvk8q7ByAXyvya8kwB7xkE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756215507; c=relaxed/simple; bh=EsaRH8Rw/r9i2faLtM6BloslFY/qh9DhXjGOTBIwi7c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gMqw6KyTK6o/MDB+6fNmgB/PI61mYMFHhqf0gKvPwmodIbO1hHYWbXE2JKV9HY22GWkYHxccrfSigvAh1pyZfpgjSWet45NiGMSN2/xFkX8oeOMykNEKg6HSQ08fImi+Wv54d2V8w4fIF2w/eBa5EJYmZp/I2F/jAoB3nKFmVKQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2eruq5oX; 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="2eruq5oX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87197C4CEF1; Tue, 26 Aug 2025 13:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756215506; bh=EsaRH8Rw/r9i2faLtM6BloslFY/qh9DhXjGOTBIwi7c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2eruq5oXpGWGsfS+68U3En376NhPWfnn90CEVbB4GNsntlcuWbO4312+6iUOblxAG 1ggPMnXmXItTUOv2MbkOqKWk5oW/2Xy1UmXtjPoFDpK7DEegxeyoEc84RKePRNdIkM lhbPASugIgsPt3xg/qaR+HLH8hDsTK5VkmbmJCuU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Chen Ni , =?UTF-8?q?Nuno=20S=C3=A1?= , Fabrice Gasnier , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.15 028/644] iio: adc: stm32-adc: Fix race in installing chained IRQ handler Date: Tue, 26 Aug 2025 13:01:59 +0200 Message-ID: <20250826110947.203822123@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110946.507083938@linuxfoundation.org> References: <20250826110946.507083938@linuxfoundation.org> User-Agent: quilt/0.68 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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chen Ni commit e8ad595064f6ebd5d2d1a5d5d7ebe0efce623091 upstream. Fix a race where a pending interrupt could be received and the handler called before the handler's data has been setup, by converting to irq_set_chained_handler_and_data(). Fixes: 1add69880240 ("iio: adc: Add support for STM32 ADC core") Signed-off-by: Chen Ni Reviewed-by: Nuno Sá Tested-by: Fabrice Gasnier Reviewed-by: Fabrice Gasnier Link: https://patch.msgid.link/20250515083101.3811350-1-nichen@iscas.ac.cn Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/adc/stm32-adc-core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/drivers/iio/adc/stm32-adc-core.c +++ b/drivers/iio/adc/stm32-adc-core.c @@ -410,10 +410,9 @@ static int stm32_adc_irq_probe(struct pl return -ENOMEM; } - for (i = 0; i < priv->cfg->num_irqs; i++) { - irq_set_chained_handler(priv->irq[i], stm32_adc_irq_handler); - irq_set_handler_data(priv->irq[i], priv); - } + for (i = 0; i < priv->cfg->num_irqs; i++) + irq_set_chained_handler_and_data(priv->irq[i], + stm32_adc_irq_handler, priv); return 0; }