From patchwork Mon Dec 28 12:51:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 352719 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp9830267jai; Mon, 28 Dec 2020 07:28:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMAnvxWZ1/xN8SwfrBKz3nX6Lh/OVQq+fqTKrOorp2D3XaASjqGMwC+nBKr/BkLjJCfpX7 X-Received: by 2002:a17:906:410e:: with SMTP id j14mr42301963ejk.253.1609169323621; Mon, 28 Dec 2020 07:28:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609169323; cv=none; d=google.com; s=arc-20160816; b=qgv1yRoDuPAbnLO/3B0Srj4w8whMh7CSKUs2bKYMGd7oJzb0KKTMJkGacT0bVQU8wt jVlSxP40FXb12JWpEeT53zxT5ySk627O3SYU3npm4ypJ59+p2CzGe9leQ1VfCet24ip5 yX6qYkYxgYuwUXx+1XkzOk9/R55WR9VKx8MMAk1gfPdc2329HoBaaFqvC1Gt1OeH9waZ 0EJTnZayVBOje4iKAAFwy2mVzrzJn4ahTSgGLPFogCGRnNcIPj9zmG4QNJEjjoALFv9v nM6ehkE9DDzgVoUFu4GCNvrsZUfAPwGGHte6PcZ+B2SCo4Q7c7WvrRxCPnq8PBP27vrn ijLQ== 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=bIZ4xjGM8M5TtQQq+W3rweUrXJoJDZo0wg2im84n8Xc=; b=r9ggO6ZRo17cDBK7HgHMQ7Zsx94SP2fu0n5SM47g6pbGyWEhu6IYcKmjV3a8GNOaYF 2gxSH7/Bfdc70btO8tymfV0k7XFjJSAz/AGCSeZuxgvzpz4ldCHJtmu7Mm2il7AeHC0p go77SlaMYA0WwzluUlB0XgseydtjzdctocynjBcB4lrjlRWCMF6TwskAISCr57UpKLHZ vstgkHpPt2Px2qofangNetsfxnBZyxIQ4cwG6h9w5RM0m0E1iBHJourRJyfNVohlwoa9 vjrC71/1Ty6vXmSy3foMu0VX/Dh5pWt84ls6KcZJKKlo6B9JMkxjDhyMJyqJiXnYefr9 p5uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JPITaN5v; 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 lf25si18977218ejb.303.2020.12.28.07.28.43; Mon, 28 Dec 2020 07:28:43 -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=JPITaN5v; 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 S2392563AbgL1P1D (ORCPT + 14 others); Mon, 28 Dec 2020 10:27:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:58638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406792AbgL1N5t (ORCPT ); Mon, 28 Dec 2020 08:57:49 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C8C5F22583; Mon, 28 Dec 2020 13:57:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609163854; bh=2gBg5QTkC7zG046XzWyEoeI1tTw2t8h+4ks/k1PY7iU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JPITaN5vdTVCZyDwDeCAwX5ZnJzh7RwY+6UIsV+ssfI5SEATjWySy4XbApwJKdymA RQEfpQU/nFp5KPfwDE0FPuyinseNTCTgDtSyh5/aVpI5oOuGniEWxAsbI4h9uR8jLP k9PkDypq+vbZEqLg/xxVLRGD+/oAeoAa1fUgcoJU= 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 5.4 431/453] iio:imu:bmi160: Fix too large a buffer. Date: Mon, 28 Dec 2020 13:51:07 +0100 Message-Id: <20201228124957.966222135@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 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 @@ -411,8 +411,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;