summaryrefslogtreecommitdiff
path: root/crypto/pcrypt.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2018-10-27 15:49:26 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2018-11-09 17:41:39 +0800
commitfb4e73b6f65e8ffcbe7ee5046691cda42cbcb00f (patch)
tree7280a55f6e73dca5bf4a6c203247de567aaaf7de /crypto/pcrypt.c
parentf08d1d365284fa4f94e221283a2074a8d40c2e25 (diff)
downloadlinux-crypto-fb4e73b6f65e8ffcbe7ee5046691cda42cbcb00f.tar.gz
linux-crypto-fb4e73b6f65e8ffcbe7ee5046691cda42cbcb00f.zip
pcrypt: use format specifier in kobject_add
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: d0d9302487e7 ("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>
Diffstat (limited to 'crypto/pcrypt.c')
-rw-r--r--crypto/pcrypt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c
index f8ec3d4b..a5718c0a 100644
--- a/crypto/pcrypt.c
+++ b/crypto/pcrypt.c
@@ -394,7 +394,7 @@ static int pcrypt_sysfs_add(struct padata_instance *pinst, const char *name)
int ret;
pinst->kobj.kset = pcrypt_kset;
- ret = kobject_add(&pinst->kobj, NULL, name);
+ ret = kobject_add(&pinst->kobj, NULL, "%s", name);
if (!ret)
kobject_uevent(&pinst->kobj, KOBJ_ADD);