Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9231405pxu; Mon, 28 Dec 2020 09:58:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNX92ienkrla7Ubo3CHPXvT+Aj7z104tWJvFZIXwL+zNdi5DNgZm8V4HoU9v79N7PCrlnp X-Received: by 2002:aa7:c603:: with SMTP id h3mr38943103edq.254.1609178287786; Mon, 28 Dec 2020 09:58:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609178287; cv=none; d=google.com; s=arc-20160816; b=A9WfsRqni+MXqAmxoBJlYROP2fFFNU4ffK7+luh5TKGJK+qkEexG9Bf8wkIujpJ+Af FmUz28Oi/yuuy8b1ljcbtysja077rWB/SK528UaUXuX2F97kO1/MSbRSD87nB7y3lwFK oTg4Do9E0s80bM0eV12F4zcGcYRG48vSIuCy+hWpB4Mh4CwvxEWnNMa2I81JuL9Nv969 uCcKIBt+0lS1YM8NPWXOu1geRpmVgAIHzRwZgBZe5q+Qrnq+boVBhKBMwU9Ra/t6qYco O+o4wHPMvZ+md2/UI3rKHca/AVq8Wm9qUDptmdFLZstFZPx72+cnjOg3+9L3Zb5ub8xX DlDg== 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=f3is4QCh0fs07bwZ/kDyYPgeDWREle4QYHTpZ0+0H9E=; b=i0nqqWWoiU0deTDOX7Nxo+mZHmI2wqXHPUgsvpTgFC2+HaJnfoocSJaunxove1O0fF c21GCvmHeKV0Pao5VOxBUM8vp/Oi6ppOHX8R5s+We/2hhG1g8k87S6es2ORvXf286+sR oQgc/nvoW2VPA02ETGD3ja1vy+OmxlCNN+5zV5uvkbX/o6ezUwz0Lzx8S4vlSQVzH/bc 7BXEDUy4pJEkPykUMzLhwCPFH8d7CQFQmgRUoBXNkBQvnPx9KOYT+8zHfqtBPX6XZjd/ 1LHMYfZV3kh0KL0eq0b6yBWSXZksz7t2gwrjc4i043YdZq6TKmLD10/jU2A8xwLuRm0W g8Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ejIExHft; 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 kq6si10728470ejb.300.2020.12.28.09.57.45; Mon, 28 Dec 2020 09:58:07 -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=ejIExHft; 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 S1732922AbgL1NTA (ORCPT + 99 others); Mon, 28 Dec 2020 08:19:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:47572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732926AbgL1NTA (ORCPT ); Mon, 28 Dec 2020 08:19:00 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id DBADE229EF; Mon, 28 Dec 2020 13:18:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161499; bh=2YZw7wCLyGVNFFzDpITey1NEnjY4pxUC+9RaSbH0c3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ejIExHftQrpmeoUNtSilcfgoc6Vq6Tmcglht2Ae0gXLRB7zQKjTehkeaA8EMme7/Z EZo1t4Xc1jxhxnDM1rBBo3T0qiOdPN8I4PuiNPo/7P6kcnH3mESh1bo/4h5VyRek/z +hOUkuQeL2vbpXxqqHu8eAZEcepHraXHJg0vXNVA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Cameron , Alexandru Ardelean , Daniel Baluta , Stable@vger.kernel.org Subject: [PATCH 4.14 232/242] iio:imu:bmi160: Fix too large a buffer. Date: Mon, 28 Dec 2020 13:50:37 +0100 Message-Id: <20201228124916.105065305@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@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 dc7de42d6b50a07b37feeba4c6b5136290fcee81 upstream. The comment implies this device has 3 sensor types, but it only has an accelerometer and a gyroscope (both 3D). As such the buffer does not need to be as long as stated. Note I've separated this from the following patch which fixes the alignment for passing to iio_push_to_buffers_with_timestamp() as they are different issues even if they affect the same line of code. Signed-off-by: Jonathan Cameron Reviewed-by: Alexandru Ardelean Cc: Daniel Baluta Cc: Link: https://lore.kernel.org/r/20200920112742.170751-5-jic23@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/iio/imu/bmi160/bmi160_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/iio/imu/bmi160/bmi160_core.c +++ b/drivers/iio/imu/bmi160/bmi160_core.c @@ -385,8 +385,8 @@ static irqreturn_t bmi160_trigger_handle struct iio_poll_func *pf = p; struct iio_dev *indio_dev = pf->indio_dev; struct bmi160_data *data = iio_priv(indio_dev); - __le16 buf[16]; - /* 3 sens x 3 axis x __le16 + 3 x __le16 pad + 4 x __le16 tstamp */ + __le16 buf[12]; + /* 2 sens x 3 axis x __le16 + 2 x __le16 pad + 4 x __le16 tstamp */ int i, ret, j = 0, base = BMI160_REG_DATA_MAGN_XOUT_L; __le16 sample;