]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
staging: nvec: Fix incorrect null termination of battery manufacturer
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Sat, 19 Jul 2025 08:07:42 +0000 (01:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 10:08:44 +0000 (12:08 +0200)
commitfaa45887a63c1374df347a4b6a6bc1b369eca70f
tree1f90637d692fff9af3067897c560d93435add1e9
parentcc03984d7035f38675afe187e0f0e45c071f364d
staging: nvec: Fix incorrect null termination of battery manufacturer

[ Upstream commit a8934352ba01081c51d2df428e9d540aae0e88b5 ]

The battery manufacturer string was incorrectly null terminated using
bat_model instead of bat_manu. This could result in an unintended
write to the wrong field and potentially incorrect behavior.

fixe the issue by correctly null terminating the bat_manu string.

Fixes: 32890b983086 ("Staging: initial version of the nvec driver")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20250719080755.3954373-1-alok.a.tiwari@oracle.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/nvec/nvec_power.c