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 BC8931D63F3; Mon, 23 Mar 2026 14:22:28 +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=1774275748; cv=none; b=QpIzX0Dwzv6hRngWkINLDlvbj9FgGrMhYAYBWaxiJBjwcnnq/N3zjfLcplBScUZjs7i63z6bWInpBi0Q9/bFm7nWNW/g45MMsi4S4XtZuOr7CC45xJ4h+X5JfTkr9NyLdaMieq+Qx09VGNoKEtwoLhTRDeJf5M+WIvXz+GVLjbE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774275748; c=relaxed/simple; bh=nadLwXW4hogQ0T3t1Yzw7vJQp5ADXRx/p2HKaHBnV48=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RJYnpdWvnfyboIJEgPoNad11L2tNWjAwkJdL4HHwgDLOoLimTQDjPq8ky3f0JjOJpJAB+DYtHKGka4RnuiLPiJoxxbfSq8RG9X7wk6NlK4SJRAl5emhthnyk8YRIskk4pSnr8DbuoqTbZudM/4wKLRPcdeuYntQr0np20waIqPA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1KLRGk0o; 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="1KLRGk0o" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D534C4CEF7; Mon, 23 Mar 2026 14:22:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774275748; bh=nadLwXW4hogQ0T3t1Yzw7vJQp5ADXRx/p2HKaHBnV48=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1KLRGk0oIrgaL4BMeb/0pCO3gw2p7PCi+L4Zmy12MjpCOsxxJ0/xjcRm4XBEHq6xO QOgfY1QhljIsiBI4lZVLpBmRP9s46XRBkbOCaWmVg4QI9nVK0H01FzJgCG89wP+RJ6 4Kq3cWz9U8g6eEuABkkB5aUW6fj9pYCQcU9lwU6I= 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.12 206/460] iio: chemical: sps30_i2c: fix buffer size in sps30_i2c_read_meas() Date: Mon, 23 Mar 2026 14:43:22 +0100 Message-ID: <20260323134531.590821706@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134526.647552166@linuxfoundation.org> References: <20260323134526.647552166@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.12-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)