From patchwork Mon Dec 28 12:51:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 352677 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp9796428jai; Mon, 28 Dec 2020 06:41:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+6+lHuO+3nNXCnuOMH8aMdQWCVJhjNko5+d1xWbQqFn9iRGpHMAsR/OL/JVzBNxgtd4/2 X-Received: by 2002:a05:6402:1696:: with SMTP id a22mr42904111edv.385.1609166492971; Mon, 28 Dec 2020 06:41:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609166492; cv=none; d=google.com; s=arc-20160816; b=hQP9jjtx6ryr81zRk62tEeWK3vvH4kKaNSMHYwvZI8V5jPmq/ViwnMS7Kl2lPG6SwI +igFslndGORMAxyLUyN30TeCSYHpOhKp/ERnD9fr62Wt0Ek8VI1GcRZLTm5Aes1MVS98 gffrz6sYG30+4yDKEsZqaeVsmhxj2NVhnzndsry5XU5TdOXVr3dWlDE13V0qo3043tOS UwhaArRMOVwDJGCbrNkBXJufg5fhlyuiwNFjGEKuzQ9q8ztGVqDwIpQnkqj6V+WLNVKx ZoYzEg7d+KCkHHzviX4yHrSLWT6neAoQmx0ir16srCPQeSIvHf0dBr5v/cWATzZsrklx 0iGw== 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=UZTWxB3/HOcYrC61cKgitB7ZDlT7j4j5u4r4RKRfV6RnOjBIHE+8xbTY1oBe8jnoTs nA7bSpCr6xdksvtMg2Id3z51iHjUHlXu0SE5FwOC7KCuU0D5/3soBia91CTjHk8vpaKZ aIkgpN5PfBiVf+4bC6lzRVJGJ+erzxIfKGJh5jr2zhcltvoiENVUSiAle/eq7TeArZAc GjvPeGy8BKbxNTYxLPJSSNO65o/TjQPohYBjEv/sElKfFQtzqTra3N+ndNzJ/qVTNy6J qeN93oAogK4TQjWdMrxxZLUP56uOd6oz3Clz68KjnL3fFMTlZbPXyqOoWK3DbshvCwPN kcIA== 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 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 os24si19005124ejb.680.2020.12.28.06.41.32; Mon, 28 Dec 2020 06:41:32 -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=VedWapl3; 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 S2504819AbgL1Ocs (ORCPT + 14 others); Mon, 28 Dec 2020 09:32:48 -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 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 @@ -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;