pcrypt: use format specifier in kobject_add
authorColin Ian King <colin.king@canonical.com>
Sat, 27 Oct 2018 14:49:26 +0000 (15:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:02 +0000 (14:50 +0100)
commite0e7ae6cc7818378fab0da7602126f0bac331d0b
tree401bbc291c3f9b5ff3e8c8d9f32acf525a9ed888
parent50d0d1b05b080fdb0ce497ffbec69e86afde0a26
pcrypt: use format specifier in kobject_add

[ Upstream commit b1e3874c75ab15288f573b3532e507c37e8e7656 ]

Passing string 'name' as the format specifier is potentially hazardous
because name could (although very unlikely to) have a format specifier
embedded in it causing issues when parsing the non-existent arguments
to these.  Follow best practice by using the "%s" format string for
the string 'name'.

Cleans up clang warning:
crypto/pcrypt.c:397:40: warning: format string is not a string literal
(potentially insecure) [-Wformat-security]

Fixes: a3fb1e330dd2 ("pcrypt: Added sysfs interface to pcrypt")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
crypto/pcrypt.c