From patchwork Mon Dec 28 12:51:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 352680 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp9797282jai; Mon, 28 Dec 2020 06:42:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUMQtgS9YcpAhBfssxT2/nqAKV6fFaibd/oXvHaiJIRQ91zBeALHEWnR1OWdKRbulKGvb7 X-Received: by 2002:aa7:ce16:: with SMTP id d22mr42261679edv.381.1609166574666; Mon, 28 Dec 2020 06:42:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609166574; cv=none; d=google.com; s=arc-20160816; b=vs+FofAjUv7tNRWs0FfiTb2v0xEfS/7jxl5uH164UE+OGTbcjAunaQ+jSWMeXgVuEI vVB4lmXlYPk2uXnOsA+uABz+eOIZ022MKM8qF6EPw2kFPdTw9h6zImjWJ28F82YxSn1/ 0Iqxzig0Yblo7dGXRWzBx52FvGaAfqTVKr8jiddoo4gAFMqwcVfY1mY4W9wKrJFzsepK +ePZQY81YfR39unvoMBqQXVErmqDI3eN8jEXIZxLPu0vcgizTYX/Yb7F3VQQcsufzCc5 7bftZHtwgvJNpPD63rOVMiTB7neDPDAvjtnlKvxS23KDLH9nKzenpDdaYSLz9tXIXCau drMA== 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=lInz6otFiBUdewGRGaGsGsdEq/Z7Z+++IWHPX6SzWFk=; b=dfe5v6givZGjGqFsrlweJ2tTGJtTI5q36nkQ3NsT1YPPVTLQ99SquFeyOlX5/r+Vai iuWJ/qqao2w+895DEIQewUXyy5OLRV/YTneGRJJjcWjyUtGIz5VkJ050HQp+51qhAKhA MnbHFdWUt0p6xlUXgiOYyTAwyWG3X/X7qla5xQq1b1FodhTa0x98CmgtVEDuo5rbF/tn UA+0uItu7gHtWsxS0NZCAe/+ZyqjTKlQN4Y3e60fdUDCUudB5QRE0Nf2Yn2VXWXP746i Oy6qF8ZjOcTrh8uUNh+texe3PH20Ag62YELM4nyzxFLDosghyvNwH7+nbE+mcaETtatV IfeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o+CNjFyB; 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 dm18si19719632edb.422.2020.12.28.06.42.54; Mon, 28 Dec 2020 06:42:54 -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=o+CNjFyB; 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 S2504783AbgL1Ocn (ORCPT + 14 others); Mon, 28 Dec 2020 09:32:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:40476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504777AbgL1Ocm (ORCPT ); Mon, 28 Dec 2020 09:32:42 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BC3E0207B2; Mon, 28 Dec 2020 14:32:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165947; bh=K24iJRIX4DRU9kl3rbz/XpvapenhOV22LKkXKlb/PJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o+CNjFyBO/uuWMs4wwStOlEAEHE0jyc+erJriEuVOYObsh05dn8WnJ+jRfw9rFsjn YCDEqP/E6SJ2M1Q6bBBIQGd3dGVSz7GAN5IPlcKgDysoS2BHxD0wKwhUaopa62PFTt xkMgHvK/jO7yTyUbRdIUBgHF4ty1W2HOk69GCk78= 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.10 681/717] iio:imu:bmi160: Fix too large a buffer. Date: Mon, 28 Dec 2020 13:51:19 +0100 Message-Id: <20201228125053.607081381@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 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 @@ -427,8 +427,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;