From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3AF4E3B47FA; Mon, 23 Mar 2026 15:09:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774278591; cv=none; b=Rz0dG/gxIAn8qemtB10ZwjZdXmIabzMSo+PK2OpJyzjSXsp3wEAwvFhrmJ4b2xjApy95sqXJd4YVrFNurlxNOVWRx2eHyV9vEUfCaJzHh10ZhJbCNsno94+jejfcNEhL2OEkD+X6l5FoPyStcrWDKTiJMksQQ7fDBE5jE92a4ww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774278591; c=relaxed/simple; bh=GWj3nTXoXYDjR3urAi78sXMUfP8lOLyWVZ4J5V1xttw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NVCKFC1q8eU4d3TA02AZfW+9MGzordgDULVeWVuOgpSPW8SivhrvBkR5tKqplUek3oF4a9rfeNJl/3D6NY5CLwuaJ8RUiWH/2BpgNjmBVh/apAPqmaYiAoBdzTPTk3OuE8Wh4mC+yX5dGKDGkuj+PMkFzj+lpmKf80FFbXVf1KA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GCMe6R+Y; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="GCMe6R+Y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DBCCC4CEF7; Mon, 23 Mar 2026 15:09:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774278590; bh=GWj3nTXoXYDjR3urAi78sXMUfP8lOLyWVZ4J5V1xttw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GCMe6R+Yd7bspau9bUD47Y1L5Jo02FtiOpJ4/gEyUdJicF35IMI4IwcUKwYaotKJp hc5DSOULvwCYrl486jjOHL+yAtZJ/cvG8cwR3Glicnsp0cs1OefDq3d4DRXNDs6Au8 T5INYZSYJc9g2ZNqEUyM79BKoFNLy7IAg5gT9/2c= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Antoniu Miclaus , Tomasz Duszynski , Andy Shevchenko , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 6.6 355/567] iio: chemical: sps30_i2c: fix buffer size in sps30_i2c_read_meas() Date: Mon, 23 Mar 2026 14:44:35 +0100 Message-ID: <20260323134542.618158405@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134533.749096647@linuxfoundation.org> References: <20260323134533.749096647@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Antoniu Miclaus commit 216345f98cae7fcc84f49728c67478ac00321c87 upstream. sizeof(num) evaluates to sizeof(size_t) (8 bytes on 64-bit) instead of the intended __be32 element size (4 bytes). Use sizeof(*meas) to correctly match the buffer element type. Fixes: 8f3f13085278 ("iio: sps30: separate core and interface specific code") Signed-off-by: Antoniu Miclaus Acked-by: Tomasz Duszynski Reviewed-by: Andy Shevchenko Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/chemical/sps30_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/chemical/sps30_i2c.c +++ b/drivers/iio/chemical/sps30_i2c.c @@ -171,7 +171,7 @@ static int sps30_i2c_read_meas(struct sp if (!sps30_i2c_meas_ready(state)) return -ETIMEDOUT; - return sps30_i2c_command(state, SPS30_I2C_READ_MEAS, NULL, 0, meas, sizeof(num) * num); + return sps30_i2c_command(state, SPS30_I2C_READ_MEAS, NULL, 0, meas, sizeof(*meas) * num); } static int sps30_i2c_clean_fan(struct sps30_state *state)