linux-stable/drivers/accel
Christophe JAILLET b720a10346 accel/habanalabs/gaudi2: Fix incorrect string length computation in gaudi2_psoc_razwi_get_engines()
[ Upstream commit 90f3de6162 ]

snprintf() returns the "number of characters which *would* be generated for
the given input", not the size *really* generated.

In order to avoid too large values for 'str_size' (and potential negative
values for "PSOC_RAZWI_ENG_STR_SIZE - str_size") use scnprintf()
instead of snprintf().

Fixes: c0e6df9160 ("accel/habanalabs: fix address decode RAZWI handling")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-20 11:57:01 +01:00
..
habanalabs accel/habanalabs/gaudi2: Fix incorrect string length computation in gaudi2_psoc_razwi_get_engines() 2023-11-20 11:57:01 +01:00
ivpu accel/ivpu/37xx: Fix missing VPUIP interrupts 2023-11-02 09:37:00 +01:00
qaic accel/qaic: Clean up integer overflow checking in map_user_pages() 2023-08-15 09:51:13 -06:00
Kconfig accel/qaic: Add qaic driver to the build system 2023-04-06 08:23:03 +02:00
Makefile accel/qaic: Add qaic driver to the build system 2023-04-06 08:23:03 +02:00
drm_accel.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00