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 3D7C93D88FC for ; Thu, 4 Jun 2026 08:46:48 +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=1780562811; cv=none; b=ty529mxkA7Sl95TFuzBwvbDWPbgr3qrD9G8FAHT8ZrCxH+CGYboXMD7M3B44elOSGlAJqQ3zNh7WfqjZdcCdE5bW+PP4QlOehSOs5dNYJudGdPbbUNX+GDJeqBpwdZHrB7kOvh7bPatGYwDMiuuBF6cDZIHAwC+pFk1vJ86ycU0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780562811; c=relaxed/simple; bh=gYDD7nRtnhk4o4nOSuGhoQEkdytVfngLdMzbByDLUnM=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=ZVytwHqkLgAClxbCDD5KbtnQMepljasDpN3/BW5P+9Q8j0pzD8pR2mTH2bwZzhffagci+MmRxP4a+ffd3FHwwBANc9014c0CEPPhNNr61neZRRGRVv1jdfK0hu0JvnmO7bqf4emUXeggN/c5k0VENWrT1A046sXY4kEW8zPPFX4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hsLW9ywG; 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="hsLW9ywG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 111971F00893; Thu, 4 Jun 2026 08:46:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780562808; bh=GPRVUfpobNTk0BKkKSftmA287MHMgscq6xWJp7F9b7s=; h=Subject:To:Cc:From:Date; b=hsLW9ywGvsEsGJU0m+10plsG4OMxWqXMK94U/Z11y8U/wBFrkW/0+ZRKZIrY2k2S3 3FZRQGDH4nP/ux+7CPRTOKLug1/TShIY3DZuobHkef1xvBDXWXtN1h7jaMKTVlPm+w 4t6QArATRXZQCwgkdm9tZ7vcRE2nksuEJ40f+md0= Subject: FAILED: patch "[PATCH] iio: gyro: adis16260: fix division by zero in write_raw" failed to apply to 6.6-stable tree To: antoniu.miclaus@analog.com,Jonathan.Cameron@huawei.com,Stable@vger.kernel.org,nuno.sa@analog.com Cc: From: Date: Thu, 04 Jun 2026 10:45:52 +0200 Message-ID: <2026060452-maturing-stimulate-cb92@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=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-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-6.6.y git checkout FETCH_HEAD git cherry-pick -x 761e8b489e6cf166c574034b70637f8a7eadd0ee # git commit -s git send-email --to '' --in-reply-to '2026060452-maturing-stimulate-cb92@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ From 761e8b489e6cf166c574034b70637f8a7eadd0ee Mon Sep 17 00:00:00 2001 From: Antoniu Miclaus Date: Tue, 31 Mar 2026 13:13:00 +0300 Subject: [PATCH] iio: gyro: adis16260: fix division by zero in write_raw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a validation check for the sampling frequency value before using it as a divisor. A user writing zero to the sampling_frequency sysfs attribute triggers a division by zero in the kernel. Fixes: 089a41985c6c ("staging: iio: adis16260 digital gyro driver") Signed-off-by: Antoniu Miclaus Reviewed-by: Nuno Sá Cc: Signed-off-by: Jonathan Cameron diff --git a/drivers/iio/gyro/adis16260.c b/drivers/iio/gyro/adis16260.c index 586e6cfa14a9..91b9c5f18ec4 100644 --- a/drivers/iio/gyro/adis16260.c +++ b/drivers/iio/gyro/adis16260.c @@ -287,6 +287,9 @@ static int adis16260_write_raw(struct iio_dev *indio_dev, addr = adis16260_addresses[chan->scan_index][1]; return adis_write_reg_16(adis, addr, val); case IIO_CHAN_INFO_SAMP_FREQ: + if (val <= 0) + return -EINVAL; + if (spi_get_device_id(adis->spi)->driver_data) t = 256 / val; else