Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9100502pxu; Mon, 28 Dec 2020 06:39:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUM4mf7uODjmwbhhCG+V3JGUe/RK44OWnO5I9SO2bchmPUD1BjqrHPi+eka7SyiRtMUDSW X-Received: by 2002:a17:906:e15:: with SMTP id l21mr42058416eji.509.1609166353812; Mon, 28 Dec 2020 06:39:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609166353; cv=none; d=google.com; s=arc-20160816; b=W2A8nxoRA+MFvo+SrcdG1V9wHkJMOQkAsqnDADqMNtWr1QsdmP4dqsgpbyz+U0/16d Ct4RlBYvENOQAcoILnQ84FLiurybGZtTtahRdlIpXsDWnurIbz/Xnk62oz14MD/LpjjB 2TAlXYdiWdInNFIjtswpgVf07tP6o3wrOM66ZwpCKJnbQZzokP4BMiu8cluA/v+l1JNI YueGo4i7HF1erY2ADbAEpAKJoWAU848oLVdiyjRu5DleUO0Q9OKhkoIRBJoStpZNOgQe kCKwC3ZhKq0E95gvVJ/iHxqreQLgEemh4G9NQXLmZHkpJg/EPg85Q7epCrOISHJSfHvH +4hw== 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=Fz+d8XPeCthwY/okNzDS+cDS41fbdBHXCCHvMa0HJg0=; b=bF3yttaAi75TGgk8KohFIj41yPnNjuKNWGNPfiI4fdvhJvpN2yvCB4lj3Hns+krYpT mdlZXAHdykZxjp5+p3LebgO8RLNAq3JzMgxa/LnauQCVxxUEnjhXwmAwHXMist0lIGR/ EasOw5ONn/wRJV+XfCfT5dnzcmbBPiaH28ZJNqQRWrrhgLSgpJzQqRc+a2ZCtI/LxA8p 4xouPkkqkARlGAfab6E1aKdkeMtm8OLMoEoCuPSkxfPt06+e/OfSc6o7d42m3e7e/UPC 5bc8LTdlz+Dr2gkmyv6oBaSIbu6UtiRcXu5DiwL8f+13KYOTtrah4nhf8hlwY9ZS3BC5 XU3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VedWapl3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 p11si18383739eja.213.2020.12.28.06.38.50; Mon, 28 Dec 2020 06:39:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=VedWapl3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S2504930AbgL1OdN (ORCPT + 99 others); Mon, 28 Dec 2020 09:33:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:40036 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504813AbgL1Ocs (ORCPT ); Mon, 28 Dec 2020 09:32:48 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8443A206D4; Mon, 28 Dec 2020 14:32:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165953; bh=smG/aTLmxfW2OTiLlHbG4bk9Dx2lwdkpKXFG26FYYK8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VedWapl3QYltKdg9JGOmed6QJY32CE7Uqp9rPSvqQWXyZ8UMonLuKapNiiIb9u7IG 7M8tQI8RyJKEmXSMN1oc62Oa9Hpn6wySqcoLtS/YxF487ykGSpeeTxoDhWK0OSa/DS xcl6ECEzaOHYLX0LxJ9iVrIisqphJmx/lxcOQ+W4= 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.10 683/717] iio:adc:ti-ads124s08: Fix buffer being too long. Date: Mon, 28 Dec 2020 13:51:21 +0100 Message-Id: <20201228125053.703955270@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 @@ -269,7 +269,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;