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 8EAB222256B for ; Mon, 2 Feb 2026 16:23:44 +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=1770049424; cv=none; b=TUQU2gmFze2WEDT/VCiux/M+P0/KzSTHmI1r98QyAs9UO9KMUGvykfMGpqMkRJK6V5oljtkZ4g1lcLuqNTo0OAGl0V8nAu0ecFSgsSXYj8aFshMFOPDqxXSfoyVPB+NOBNAmn7ogpSGePKb/BVDGGKZaN+ms49wabEs4RXd/lcE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770049424; c=relaxed/simple; bh=WpshZHl9dLPNjgzv1d3F/dZ4IeNUQ34ygTarJBmc17Q=; h=Subject:To:From:Date:Message-ID:MIME-Version:Content-Type; b=nAEoKYJWRamvn5cJAyJXYs04OLTJI3TO1MKie50vk/BufQb541h2N+5tYXTdePimPXO2QzRwcpu28juaHybKx8pmi3lz/xQzJjjcv53c6BRRVoi1X4moYZH/AzHC0Mm9A9JtJKdCc2EsGz0olSPGo5eMXK5xrLSmXm94dkCEIxI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BfVf4qfp; 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="BfVf4qfp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7BC3C116C6; Mon, 2 Feb 2026 16:23:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770049424; bh=WpshZHl9dLPNjgzv1d3F/dZ4IeNUQ34ygTarJBmc17Q=; h=Subject:To:From:Date:From; b=BfVf4qfpFTomrhJa3Fv1roRqQpzk4cbEj+C14XUHR7BCAvtPWIaAe612WvBA3geRD BVyaQG4hxEcY1rp6bWNLrelaE5UW0PcWGkNUqF2NouTkPdkuKtySZicRRWE9pWUP10 A3pddoWl6O67FfZzctWumoCYwXZuI0yRZhrSj/Y0= Subject: patch "iio: gyro: itg3200: Fix unchecked return value in read_raw" added to char-misc-testing To: antoniu.miclaus@analog.com,Jonathan.Cameron@huawei.com,Stable@vger.kernel.org,andriy.shevchenko@intel.com From: Date: Mon, 02 Feb 2026 17:09:33 +0100 Message-ID: <2026020233-canopy-dramatize-6923@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 This is a note to let you know that I've just added the patch titled iio: gyro: itg3200: Fix unchecked return value in read_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-testing 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 be merged to the char-misc-next branch sometime soon, after it passes testing, and the merge window is open. If you have any questions about this process, please let me know. >From b79b24f578cdb2d657db23e5fafe82c7e6a36b72 Mon Sep 17 00:00:00 2001 From: Antoniu Miclaus Date: Thu, 29 Jan 2026 17:01:45 +0200 Subject: iio: gyro: itg3200: Fix unchecked return value in read_raw The return value from itg3200_read_reg_s16() is stored in ret but never checked. The function unconditionally returns IIO_VAL_INT, ignoring potential I2C read failures. This causes garbage data to be returned to userspace when the read fails, with no error reported. Add proper error checking to propagate the failure to callers. Fixes: 9dbf091da080 ("iio: gyro: Add itg3200") Signed-off-by: Antoniu Miclaus Reviewed-by: Andy Shevchenko Cc: Signed-off-by: Jonathan Cameron --- drivers/iio/gyro/itg3200_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iio/gyro/itg3200_core.c b/drivers/iio/gyro/itg3200_core.c index cd8a2dae56cd..bfe95ec1abda 100644 --- a/drivers/iio/gyro/itg3200_core.c +++ b/drivers/iio/gyro/itg3200_core.c @@ -93,6 +93,8 @@ static int itg3200_read_raw(struct iio_dev *indio_dev, case IIO_CHAN_INFO_RAW: reg = (u8)chan->address; ret = itg3200_read_reg_s16(indio_dev, reg, val); + if (ret) + return ret; return IIO_VAL_INT; case IIO_CHAN_INFO_SCALE: *val = 0; -- 2.52.0