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 8576E47D930 for ; Fri, 15 May 2026 11:46:35 +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=1778845595; cv=none; b=SW2zjvFWTX6C61ZRjUP4WH05EDBooQSP/y7u32b0T6wng/3xEz1FEGx5z3vZOJ2nQWsy1zvq8NDgJmUyNCmOLj6bDkQIMPft1eUFjQ3PuWt4ugeUl/GnmESE3pQPu2DNP2XE1j08EbiVLjxH6KYo/B9mN3UztVIR39Y9wXz+zmE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778845595; c=relaxed/simple; bh=JioL9+uGPEaUQU3v/kpY+IoOl5w4Hdh8U6IjeoLFh0s=; h=Subject:To:From:Date:Message-ID:MIME-Version:Content-Type; b=JsDOYlGlhYLoY6GPD5EqJjPVu+wg/tc4Doiqk+o14YqtkvtpMZMzjGjED+rajiwG9i2xmLUCzeyVcDPm60NrPcSF6bJBf6K3b1EyJ6+kDHBugJx3iUnbMT7CPcUhLgo+hKu1589bZAxQKPrc9EHffz9h5VRmoXQvtx7So4SrII8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=oyX754sf; 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="oyX754sf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0361C2BCB0; Fri, 15 May 2026 11:46:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778845595; bh=JioL9+uGPEaUQU3v/kpY+IoOl5w4Hdh8U6IjeoLFh0s=; h=Subject:To:From:Date:From; b=oyX754sf2Y8AYT992f8KgAW10Yfn4PuAW5M9Y+GdVEHUuaN4rHcRqy3JGz+Ssbdmx 6v4LsjY1zfjrFM4nAtnL98NN15qWs+oUsLs2qv6zIlM7iBxgwL3j3Kl7VGTzqbFyqn DXU74PNiggEhw9wKDkqhWrIztBEcH+6frrFSzMBA= Subject: patch "iio: adc: mt6359: fix unchecked return value in mt6358_read_imp" added to char-misc-linus To: salah.triki@gmail.com,Stable@vger.kernel.org,jic23@kernel.org From: Date: Fri, 15 May 2026 13:45:59 +0200 Message-ID: <2026051559-freeness-endeared-ab70@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: adc: mt6359: fix unchecked return value in mt6358_read_imp 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 f9bbd943c34a9ad60e593a4b99ce2394e4e2381b Mon Sep 17 00:00:00 2001 From: Salah Triki Date: Mon, 27 Apr 2026 21:12:38 +0100 Subject: iio: adc: mt6359: fix unchecked return value in mt6358_read_imp In mt6358_read_imp(), the variable val_v is passed to regmap_read() but the return value is not checked. If the read fails, val_v remains uninitialized and its random stack content is subsequently reported as a measurement result. Initialize val_v to zero to ensure a predictable value is reported in case of bus failure and to prevent potential stack data leakage. This also satisfies static analyzers that might otherwise flag the variable as used uninitialized. Fixes: 3587914bf61d ("iio: adc: Add support for MediaTek MT6357/8/9 Auxiliary ADC") Signed-off-by: Salah Triki Cc: Signed-off-by: Jonathan Cameron --- drivers/iio/adc/mt6359-auxadc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/adc/mt6359-auxadc.c b/drivers/iio/adc/mt6359-auxadc.c index 6b9ed9b1fde2..1d9724ef0983 100644 --- a/drivers/iio/adc/mt6359-auxadc.c +++ b/drivers/iio/adc/mt6359-auxadc.c @@ -497,6 +497,7 @@ static int mt6358_read_imp(struct mt6359_auxadc *adc_dev, return ret; /* Read the params before stopping */ + val_v = 0; regmap_read(regmap, reg_adc0 + (cinfo->imp_adc_num << 1), &val_v); mt6358_stop_imp_conv(adc_dev); -- 2.54.0