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 B0CC73CC7D1 for ; Thu, 4 Jun 2026 08:47:05 +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=1780562828; cv=none; b=pB3hBjLd03LoZF2fZT8jpGHqp5Jv72Mn4Qg6jfsagWPQbohTW+wCa2jTobN2vA6PxjFgg6VqB0dNE4PXDXpdxzDAVLkL4lSPGgfEZol4RZBCkUZRpXnAjAtRCwco3wgu59RHDcZApRRNIpXNPwpTrtf0NrMiyjRm0f7bCTpy3jY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780562828; c=relaxed/simple; bh=u0FhidNSKcY4YvX/izyj5C9uDTG7q57VCIsNPOXBRUw=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=NtN/Hn6EUMPhwrPCDkmIxgw4iCr5RCKh+5EZRlJGtvDGxrSodovnkORsFg5Uu7qc/uNO4Bmn+cs/8UPja08mE1LiNOYdBV2jmEPS6e5v5V1rp6T7LB6XFkEakH0UDcoi5nHsvPxHoiLrdfiU1AZ2gkbMfHDng0XsK/sMKSYe92w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JDSY57pY; 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="JDSY57pY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55EA91F00898; Thu, 4 Jun 2026 08:47:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780562825; bh=/17lA0Mr0agfQaALS345ogFSDAMU/mR8gO6uHQKcIbs=; h=Subject:To:Cc:From:Date; b=JDSY57pYBdXWFL8Nl6TsRkLgDSnEEqdTnfWgMAJm5dGQ54UOi66oiPMFJmXlgdSh8 LXccmLS18dOJxUfl9TeXec5e1IgnDsSkg7GemDzZ8ThTGkDsw8Pwy5K4EF3W5KYSdQ x5ZdfR84A287EVIq2243/a5mVz9Vm3IsjntPgAiY= Subject: FAILED: patch "[PATCH] iio: gyro: adis16260: fix division by zero in write_raw" failed to apply to 5.10-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:54 +0200 Message-ID: <2026060454-applause-magnify-a2fc@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 5.10-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.10.y git checkout FETCH_HEAD git cherry-pick -x 761e8b489e6cf166c574034b70637f8a7eadd0ee # git commit -s git send-email --to '' --in-reply-to '2026060454-applause-magnify-a2fc@gregkh' --subject-prefix 'PATCH 5.10.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