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 4F74743CEE9 for ; Fri, 15 May 2026 11:46:01 +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=1778845561; cv=none; b=Gq2Os+44CuznMslmubqwmGy8SPgN3LdRgZ9j+YVTUPewWlnqbYU69AjU1hOvXwnpo2b0Pr7ocRXX9WEu+JjlIxuhuv+xTIPaJhP4x1w+uiDm+aoZ66NyopUhl3by/T3AflG5yriQyAPcpehTsl5+kRaT3TDEsPKkumTp3Sxb6gg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778845561; c=relaxed/simple; bh=orp8fQYkrMfIo9Vg5T8aVOCQl03OkiQ3j1aoIx/TPXA=; h=Subject:To:From:Date:Message-ID:MIME-Version:Content-Type; b=Hp2iDE6uxsK4LguHIEWhRQNJcjaX2xd+eScMonl1VgKxLLELxG3fBfBTJzFHl756xiVcYBzqvajDt7W+nItVEF9x97U+kJpEOtJQq/oPlb1VgXsH3ExyF+NbjzBdenAsJqpABmTH4cWN57PHnl5w+oG4nmYl76C8awnejhiCodk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=zGmYl/IW; 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="zGmYl/IW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96848C2BCB0; Fri, 15 May 2026 11:46:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778845560; bh=orp8fQYkrMfIo9Vg5T8aVOCQl03OkiQ3j1aoIx/TPXA=; h=Subject:To:From:Date:From; b=zGmYl/IWhvAQAI7U6LboQQpfykifbzcf/cHTp7C1z8VJLrjINN0rJx2iaYlOSbbEl NRaJx/78jCdopz13v8juqsxAv/FBOzHUohtpH2ZgJchRadjCfGAOsaQT+rHmHLi2z9 GTDbANjAqFagrXd0ELvYmo2iVqNQZSSIUJEifeMg= Subject: patch "iio: Fix iio_multiply_value use in iio_read_channel_processed_scale" added to char-misc-linus To: clamor95@gmail.com,Stable@vger.kernel.org,jic23@kernel.org,johannes.goede@oss.qualcomm.com From: Date: Fri, 15 May 2026 13:45:55 +0200 Message-ID: <2026051555-childlike-reuse-580b@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: Fix iio_multiply_value use in iio_read_channel_processed_scale 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 bb21ee31f5753a7972148798fd7dfb841dd33bdb Mon Sep 17 00:00:00 2001 From: Svyatoslav Ryhel Date: Thu, 16 Apr 2026 14:14:42 +0300 Subject: iio: Fix iio_multiply_value use in iio_read_channel_processed_scale The function iio_multiply_value returns IIO_VAL_INT (1) on success or a negative error number on failure, while iio_read_channel_processed_scale should return an error code or 0. This creates a situation where the expected result is treated as an error. Fix this by checking the iio_multiply_value result separately, instead of passing it as a return value. Fixes: 05f958d003c9 ("iio: Improve iio_read_channel_processed_scale() precision") Signed-off-by: Svyatoslav Ryhel Reviewed-by: Hans de Goede Cc: Signed-off-by: Jonathan Cameron --- drivers/iio/inkern.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index 0df0ab3de270..9ce20cb05a9b 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -738,7 +738,11 @@ int iio_read_channel_processed_scale(struct iio_channel *chan, int *val, if (ret < 0) return ret; - return iio_multiply_value(val, scale, ret, pval, pval2); + ret = iio_multiply_value(val, scale, ret, pval, pval2); + if (ret < 0) + return ret; + + return 0; } else { ret = iio_channel_read(chan, val, NULL, IIO_CHAN_INFO_RAW); if (ret < 0) -- 2.54.0