From patchwork Mon Dec 28 12:50:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 352648 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp9753213jai; Mon, 28 Dec 2020 05:39:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwkIy4w4NqTuh+7j9GGssyj7Up2Z9HzonDvUuyqodVGRFvMhU7UxBWMbvG0IqXgniY6DBsr X-Received: by 2002:a17:906:7d09:: with SMTP id u9mr34231476ejo.380.1609162741487; Mon, 28 Dec 2020 05:39:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609162741; cv=none; d=google.com; s=arc-20160816; b=sGUJzn2QPKxr4Pi7wpgwASwlOrmlRZmJYnNEzdI8XWNGsVh3JqKDShhy9VtK8ZgAV1 ahxe1FdE9uxTrUqZOTrUa3ZltjxriLpuGQaeL21eNDV0LKRHpmHM4QSDNBxLaFxiyUar n2ow584/xgmhkfixb5GK7v/YIu5kBLdtrcbOHjfHU4B34huauXg9mtG2P4UU6L0iN3J7 BDEEgOJWfD0KQq3zwHQdH3GMRQlBrW8HFLlOPR28lf2KgQYGuDZIZV/PPd6lsErAwkOo 0sP6rlVXp0sm6Skh7YoR+TFoBcDB/2SMUMBbKk3+JxcGZDdiZPATKuZO7BN1vAukcc27 2smw== 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=n3OgDyJmH87Ecjkg/7Dbg/WgkuFnVPx7PdWT3TABC3h7O+WY+tf1kQvLQW+7G8JrzA qR6KEmVegc13ZNxvCmz06cihnN17fOXfBCytzNXtrC61VAXX98TN2OGH7+ZobtsbViqm FcY46W2UBby8nGDqfrslGprYgnTp/1OtLYewN6EjPWm9ppeayZTWmf0UvOQVInF6VaTj zrXgmV6soO2KFh55TUJSkSWX3v/Ra7Q9bimk0Wt7fVijam8Q9Q9eqley7V1vOeYPPSjm LL9IVL8rwOKANjtimAgF2BrKlonUmChrqlZGKJ7IkGOgzIFcJp0wRxumNZk+Fm4ELAnt 4qWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=n+CyQL4H; 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 m22si20434756edr.514.2020.12.28.05.39.01; Mon, 28 Dec 2020 05:39:01 -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=n+CyQL4H; 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 S2390539AbgL1Ng4 (ORCPT + 14 others); Mon, 28 Dec 2020 08:36:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:36030 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389454AbgL1Nft (ORCPT ); Mon, 28 Dec 2020 08:35:49 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 12B2C205CB; Mon, 28 Dec 2020 13:35:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609162534; bh=2YZw7wCLyGVNFFzDpITey1NEnjY4pxUC+9RaSbH0c3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n+CyQL4HhtQ88TW4d3i8BdUOfNLV7F+bEO66QJzfUvFixt5kFHAFxLLy3DS+7E+8X Du9JTTC2KsV/IwpoFYf/Ke2bGJXxlFy34BQAwpO4/GN6sgUToPzhaYs/GyEQ+iz4Y4 tD5Tx/CfjsJ1livFxeLG2CVWLowAutuJzE9nWEA0= 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.19 333/346] iio:imu:bmi160: Fix too large a buffer. Date: Mon, 28 Dec 2020 13:50:52 +0100 Message-Id: <20201228124935.872213880@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124919.745526410@linuxfoundation.org> References: <20201228124919.745526410@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 @@ -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;