Unverified Commit 786ae243 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!15080 [OLK-6.6] crypto: zhaoxin - Fix incorrect parameter in sm4 driver

Merge Pull Request from: @leoliu-oc 
 
1. crypto: zhaoxin - Fix incorrect parameter in sm4 driver

The prior patch("crypto: simd - Do not call crypto_alloc_tfm during registration") had an error in arch/x86/crypto/sm4-zhaoxin-gmi.c.
It should pass 'sm4_algs + i' to 'simd_skcipher_create_compat', like other changes, instead of 'sm4_algs'.
 
Passing the wrong param made 'simd_skcipher_create_compat' always get the start address of 'sm4_algs', not the right struct pointer in the loop, risking logic errors.
    
This patch fixes it by changing the 'simd_skcipher_create_compat' call to use 'sm4_algs + i' as the first arg.

### Issue
https://gitee.com/openeuler/kernel/issues/IBMDJH

### Default config change
N/A

### Test
Pass 
 
Link:https://gitee.com/openeuler/kernel/pulls/15080

 

Reviewed-by: default avatarZhang Peng <zhangpeng362@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents 56197cf0 b04218c4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -835,7 +835,7 @@ static int __init gmi_sm4_init(void)
		algname = sm4_algs[i].base.cra_name + 2;
		drvname = sm4_algs[i].base.cra_driver_name + 2;
		basename = sm4_algs[i].base.cra_driver_name;
		simd = simd_skcipher_create_compat(sm4_algs, algname, drvname, basename);
		simd = simd_skcipher_create_compat(sm4_algs + i, algname, drvname, basename);
		err = PTR_ERR(simd);
		if (IS_ERR(simd))
			goto unregister_simds;