mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 05:55:44 +02:00
crypto: hisilicon/hpre - Fix a erroneous check after snprintf()
[ Upstream commitc977950146] This error handling looks really strange. Check if the string has been truncated instead. Fixes:02ab994635("crypto: hisilicon - Fixed some tiny bugs of HPRE") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
0c78ae22c6
commit
00dcb2738b
|
|
@ -1033,7 +1033,7 @@ static int hpre_cluster_debugfs_init(struct hisi_qm *qm)
|
|||
|
||||
for (i = 0; i < clusters_num; i++) {
|
||||
ret = snprintf(buf, HPRE_DBGFS_VAL_MAX_LEN, "cluster%d", i);
|
||||
if (ret < 0)
|
||||
if (ret >= HPRE_DBGFS_VAL_MAX_LEN)
|
||||
return -EINVAL;
|
||||
tmp_d = debugfs_create_dir(buf, qm->debug.debug_root);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user