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 93A6E42EEBD for ; Fri, 15 May 2026 11:46:06 +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=1778845566; cv=none; b=RIOYc+RiU6kmTctDOUAjkx3VsPe6HmccM/eEyVQdc1lgP/GYBCyDDWvkMqFcSY9KrERfCE0UUvczFg7M4lvJFq/8uTN87MReWwESeVUNRtiVDAZk1hLtZ5LSyjlaagbeuiQp4TugdkrSEspmyj+K+hjaHX2H/W7A7wdiyad7KkA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778845566; c=relaxed/simple; bh=Xx0EL66htiNj6OFdUmCaIWUw0P6CvJHzeOPpPjalQ3U=; h=Subject:To:From:Date:Message-ID:MIME-Version:Content-Type; b=nmpH8KY54zOqi6Yzpi3pUMHLHnX7y2a3UsTtemPTlfrcd4/bX8oFcsuCLRDt09UXYGMh7Lcy8oo5v/QTzdV70adzICCnKuab5b5XMEKrRaamit1m6+DmuClBLpq/G9UNc7+ox26ZPhJPvV1WsyZqyV1SrLbpcDLxGOO7JY9KiIA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pMHYZYdd; 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="pMHYZYdd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12474C2BCB0; Fri, 15 May 2026 11:46:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778845566; bh=Xx0EL66htiNj6OFdUmCaIWUw0P6CvJHzeOPpPjalQ3U=; h=Subject:To:From:Date:From; b=pMHYZYddrlIZbfnslYv9pin4+Nm2kGKJGVUR26q7+mJA/acZxlOzoOY8dLdu9Lc/c iC2/JxDZwLYesQo0chPc45jEvT4oovnqb9G/44yChqpDScO0Xupn+Ch4nZO0rW6wEv fteTIXPr8Ng4Xgsxg8jsyIgjwAShwgSoh2ZirZks= Subject: patch "iio: gyro: adis16260: fix division by zero in write_raw" added to char-misc-linus To: antoniu.miclaus@analog.com,Jonathan.Cameron@huawei.com,Stable@vger.kernel.org,nuno.sa@analog.com From: Date: Fri, 15 May 2026 13:45:55 +0200 Message-ID: <2026051555-water-premium-9540@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 This is a note to let you know that I've just added the patch titled iio: gyro: adis16260: fix division by zero in write_raw to my char-misc git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git in the char-misc-linus branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will hopefully also be merged in Linus's tree for the next -rc kernel release. If you have any questions about this process, please let me know. >From 761e8b489e6cf166c574034b70637f8a7eadd0ee Mon Sep 17 00:00:00 2001 From: Antoniu Miclaus Date: Tue, 31 Mar 2026 13:13:00 +0300 Subject: 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 --- drivers/iio/gyro/adis16260.c | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.54.0