crypto: drbg - simplify ordering of linked list in drbg_ctr_df
As reported by a static code analyzer, the code for the ordering of the linked list can be simplified. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
de18cd4b71
commit
c0eedf8034
1 changed files with 5 additions and 5 deletions
|
@ -516,13 +516,13 @@ static int drbg_ctr_df(struct drbg_state *drbg,
|
||||||
S2.next = addtl;
|
S2.next = addtl;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* splice in addtl between S2 and S4 -- we place S4 at the end of the
|
* Splice in addtl between S2 and S4 -- we place S4 at the end
|
||||||
* input data chain
|
* of the input data chain. As this code is only triggered when
|
||||||
|
* addtl is not NULL, no NULL checks are necessary.
|
||||||
*/
|
*/
|
||||||
tempstr = addtl;
|
tempstr = addtl;
|
||||||
for (; NULL != tempstr; tempstr = tempstr->next)
|
while (tempstr->next)
|
||||||
if (NULL == tempstr->next)
|
tempstr = tempstr->next;
|
||||||
break;
|
|
||||||
tempstr->next = &S4;
|
tempstr->next = &S4;
|
||||||
|
|
||||||
/* 10.4.2 step 9 */
|
/* 10.4.2 step 9 */
|
||||||
|
|
Loading…
Add table
Reference in a new issue