crypto: hisilicon/hpre - Fix a erroneous check after snprintf()
[ Upstream commit c977950146720abff14e46d8c53f5638b06a9182 ] This error handling looks really strange. Check if the string has been truncated instead. Fixes: 02ab994635eb ("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
12d2087a7d
commit
0c824b77ad
@ -1031,7 +1031,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…
x
Reference in New Issue
Block a user