]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: proximity: hx9023s: fix assignment order for __counted_by
authorYasin Lee <yasin.lee.x@gmail.com>
Fri, 13 Feb 2026 15:14:43 +0000 (23:14 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Mar 2026 15:15:31 +0000 (16:15 +0100)
commit2c2661e1ed3c5c25677ceb7fb53471f742e75158
tree960e7e94c78743dfa8d1e81a696e7cd76cd349c7
parent1657b99bb89fe5efcd136d35f584e916011299f8
iio: proximity: hx9023s: fix assignment order for __counted_by

commit 585b90c0161ab77416fe3acdbdc55b978e33e16c upstream.

Initialize fw_size before copying firmware data into the flexible
array member to match the __counted_by() annotation. This fixes the
incorrect assignment order that triggers runtime safety checks.

Fixes: e9ed97be4fcc ("iio: proximity: hx9023s: Added firmware file parsing functionality")
Signed-off-by: Yasin Lee <yasin.lee.x@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/proximity/hx9023s.c