From patchwork Mon Dec 28 12:51:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 352715 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp9829182jai; Mon, 28 Dec 2020 07:27:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzP6DwpNCzwywcL2b1AcdICyKN/06ZJGCU4z6Q+eAFJa7JMr9+0sjomLBHYwDwuRNIboR8Z X-Received: by 2002:a17:907:2071:: with SMTP id qp17mr42478135ejb.110.1609169226268; Mon, 28 Dec 2020 07:27:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609169226; cv=none; d=google.com; s=arc-20160816; b=JFNQEr/zg6HDBDeZ8De0HFleq0z3/+8bBTifAbbFqZ5ygehCCqPwGMSrxF9WYc1pB8 Wh4hZl4LSNsi0TW1BeamAqtWeFdLdcuSTCZuo5PX9zv7K4qAXREJ0J/kg+0rD8l7FLX8 Y5Omx807X1XyrP3xflSBiMB1u5zYpHg2NwznZZqyXlOAna7LrDdCbh73/Khz5mGwELKb NAempe6b91V0YV3FOD65F7cxVGMmG3M4lz/LRV263SUMX8Tk7eaqz2Be7BzplAIbysf1 sH7S7vbiydoWKu1nwz8WPd4/nlkGQynMNDnYqlVX3m+kiIDXe0igi1J5hsQklrGOKr0r OO1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=F1Gx3MAVjhMzYsj9XcPLUQzeGCFucfKeJ5+eRdtpxQ8=; b=KHli4kIbwEf1QuPGbSdjJB8/P0Pwvq1zG71/sgDja3Z2ZFPSz4V6/w4iG7HhadS5Ht bOqB0bVxNyquF8JVMfJuvfJnT6LZGR0NjBA2CWhhn5OHvJpiC4UUQWeLnScJ7+Z5OFns TsPcf+wKgKoByPgGGdDSmpFxdILLlTAnC6ERdMgKWZYI/U+eJ4dpYFDi1Xf9q2qgp+TJ uz9tgp9gXA7N6sMUjEzsgboNRffLqgdmck2FzWB2yfEZUSMSoAJJAskxi9UlCJrbQBHM WOsk3sWPRpTC9jECiDWhnjbtxQmHgVPn8LFNrut28AHxsSCKuCjWLj9bC7NA6b/mCnl3 98ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IJ4fAW4B; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q11si20313189edn.225.2020.12.28.07.27.06; Mon, 28 Dec 2020 07:27:06 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IJ4fAW4B; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391634AbgL1N6W (ORCPT + 14 others); Mon, 28 Dec 2020 08:58:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:60040 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391624AbgL1N6V (ORCPT ); Mon, 28 Dec 2020 08:58:21 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 37A3F2078D; Mon, 28 Dec 2020 13:57:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609163859; bh=JJ98nMTw0U+b1TISDdZ/VTbdI0leF7vvt/tfhi4+4g0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IJ4fAW4BVYWzRBUXQW8YPgIhIx8mn1S8ykj01Ta4tTJvoArN0M6cBqqam25w2ioGp vMaqhCIHWYojkOaJ4XzFECDX2bMVDPZ6YqOIlGAe94TYExSczgVMWFsdlhQKb+gOyW 9a0k9/gsEyQYX1zXdrzsHKv+bnTeHr7e2wwAU7sU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Cameron , Alexandru Ardelean , Dan Murphy , Stable@vger.kernel.org Subject: [PATCH 5.4 432/453] iio:adc:ti-ads124s08: Fix buffer being too long. Date: Mon, 28 Dec 2020 13:51:08 +0100 Message-Id: <20201228124958.015381701@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124937.240114599@linuxfoundation.org> References: <20201228124937.240114599@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jonathan Cameron commit b0bd27f02d768e3a861c4e6c27f8e369720e6c25 upstream. The buffer is expressed as a u32 array, yet the extra space for the s64 timestamp was expressed as sizeof(s64)/sizeof(u16). This will result in 2 extra u32 elements. Fix by dividing by sizeof(u32). Fixes: e717f8c6dfec ("iio: adc: Add the TI ads124s08 ADC code") Signed-off-by: Jonathan Cameron Reviewed-by: Alexandru Ardelean Cc: Dan Murphy Cc: Link: https://lore.kernel.org/r/20200920112742.170751-8-jic23@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/iio/adc/ti-ads124s08.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/adc/ti-ads124s08.c +++ b/drivers/iio/adc/ti-ads124s08.c @@ -270,7 +270,7 @@ static irqreturn_t ads124s_trigger_handl struct iio_poll_func *pf = p; struct iio_dev *indio_dev = pf->indio_dev; struct ads124s_private *priv = iio_priv(indio_dev); - u32 buffer[ADS124S08_MAX_CHANNELS + sizeof(s64)/sizeof(u16)]; + u32 buffer[ADS124S08_MAX_CHANNELS + sizeof(s64)/sizeof(u32)]; int scan_index, j = 0; int ret;