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 29726391829 for ; Thu, 4 Jun 2026 08:48:12 +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=1780562893; cv=none; b=RPARjVspNTQOZiQCLaXaxNXtf0gbx6XHIjt3eGQxG0GU9h+PN2jT7gjMnLSIcwPC2/ruIpZAVDkavQuP9MuNSAf3bPVbylp8XgvxJf0H6uT25yHZ46LMwQqiNmrrdiOKkB1bipPB1+1riXu6eZKH8tesDTG9iTgVqectKs7ZuAE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780562893; c=relaxed/simple; bh=HWyu+kaM1lqPiGh380of2NwKYxA6P9Q5+/QHWB/Do8Y=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=nxILETX/IzU+qMzwitkdnT+MNEqGM62Iitfwg54gUNyfIa8kVrUqxaM/DlGf3jr+Vxg2G0e8/chtwGKz1B6+Rm/aCCE4LviWqon8Xv2n4lLnrVLA0DXQbxhFwNsFc5l1IcuFFkq9cv/OrsDIpVnbS7AtV/H28hJsZB/vX7SwhJg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yC7ERFHG; 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="yC7ERFHG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C3561F00893; Thu, 4 Jun 2026 08:48:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780562892; bh=cpygei09snLQ0m8nL3S+HMoIWPlvGKvdidQUgYUMXqs=; h=Subject:To:Cc:From:Date; b=yC7ERFHGcpi0lVJPo2RBY5JIlGY4gPIKxq87/IQdXOBaT3s4kIlrmpPJTPOtI6IHC FzTC7MmM/QQrpUCfu/V+E+hktNC7cAjQ6ALwRmL7/ap/tWNZx88A3PaPa8i1f2Lqhl 4vH/5xnjTJVDSkEmpqucb0SzdZlfd/7VH7saufxk= Subject: FAILED: patch "[PATCH] iio: chemical: scd30: fix division by zero in write_raw" failed to apply to 5.15-stable tree To: antoniu.miclaus@analog.com,Stable@vger.kernel.org,jic23@kernel.org Cc: From: Date: Thu, 04 Jun 2026 10:46:57 +0200 Message-ID: <2026060457-coastal-washable-cab4@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x 5aba4f94b225617a55fed442a70329b2ee19c0a5 # git commit -s git send-email --to '' --in-reply-to '2026060457-coastal-washable-cab4@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 5aba4f94b225617a55fed442a70329b2ee19c0a5 Mon Sep 17 00:00:00 2001 From: Antoniu Miclaus Date: Wed, 1 Apr 2026 14:08:29 +0300 Subject: [PATCH] iio: chemical: scd30: fix division by zero in write_raw Add a zero check for val2 before using it as a divisor when setting the sampling frequency. A user writing a zero fractional part to the sampling_frequency sysfs attribute triggers a division by zero in the kernel. Fixes: 64b3d8b1b0f5 ("iio: chemical: scd30: add core driver") Signed-off-by: Antoniu Miclaus Cc: Signed-off-by: Jonathan Cameron diff --git a/drivers/iio/chemical/scd30_core.c b/drivers/iio/chemical/scd30_core.c index a665fcb78806..11d6bc1b63e6 100644 --- a/drivers/iio/chemical/scd30_core.c +++ b/drivers/iio/chemical/scd30_core.c @@ -256,7 +256,7 @@ static int scd30_write_raw(struct iio_dev *indio_dev, struct iio_chan_spec const guard(mutex)(&state->lock); switch (mask) { case IIO_CHAN_INFO_SAMP_FREQ: - if (val) + if (val || !val2) return -EINVAL; val = 1000000000 / val2;