]> git.itanic.dy.fi Git - linux-stable/commit
firmware: ti_sci: Fix an off-by-one in ti_sci_debugfs_create()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 30 Oct 2023 10:12:26 +0000 (11:12 +0100)
committerNishanth Menon <nm@ti.com>
Fri, 24 Nov 2023 18:49:08 +0000 (12:49 -0600)
commit964946b88887089f447a9b6a28c39ee97dc76360
tree493c17950372582e760620126b75fffb22a9bcc2
parentb85ea95d086471afb4ad062012a4d73cd328fa86
firmware: ti_sci: Fix an off-by-one in ti_sci_debugfs_create()

The ending NULL is not taken into account by strncat(), so switch to
snprintf() to correctly build 'debug_name'.

Using snprintf() also makes the code more readable.

Fixes: aa276781a64a ("firmware: Add basic support for TI System Control Interface (TI-SCI) protocol")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/7158db0a4d7b19855ddd542ec61b666973aad8dc.1698660720.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Nishanth Menon <nm@ti.com>
drivers/firmware/ti_sci.c