]> www.infradead.org Git - users/jedix/linux-maple.git/commit
gpio: ljca: Initialize num before accessing item in ljca_gpio_config
authorHaoyu Li <lihaoyu499@gmail.com>
Tue, 3 Dec 2024 14:14:51 +0000 (22:14 +0800)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 6 Dec 2024 18:04:42 +0000 (19:04 +0100)
commit3396995f9fb6bcbe0004a68118a22f98bab6e2b9
tree3d69949b188e719be1404b886089e5b667d126c9
parent70327137eb3eb64f346191dcd0ee5140d5ab34d8
gpio: ljca: Initialize num before accessing item in ljca_gpio_config

With the new __counted_by annocation in ljca_gpio_packet, the "num"
struct member must be set before accessing the "item" array. Failing to
do so will trigger a runtime warning when enabling CONFIG_UBSAN_BOUNDS
and CONFIG_FORTIFY_SOURCE.

Fixes: 1034cc423f1b ("gpio: update Intel LJCA USB GPIO driver")
Cc: stable@vger.kernel.org
Signed-off-by: Haoyu Li <lihaoyu499@gmail.com>
Link: https://lore.kernel.org/stable/20241203141451.342316-1-lihaoyu499%40gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-ljca.c