Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c0eedf80 authored by Stephan Mueller's avatar Stephan Mueller Committed by Herbert Xu
Browse files

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: default avatarkbuild test robot <fengguang.wu@intel.com>
Signed-off-by: default avatarStephan Mueller <smueller@chronox.de>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent de18cd4b
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -516,13 +516,13 @@ static int drbg_ctr_df(struct drbg_state *drbg,
	S2.next = addtl;

	/*
	 * splice in addtl between S2 and S4 -- we place S4 at the end of the
	 * input data chain
	 * Splice in addtl between S2 and S4 -- we place S4 at the end
	 * of the input data chain. As this code is only triggered when
	 * addtl is not NULL, no NULL checks are necessary.
	 */
	tempstr = addtl;
	for (; NULL != tempstr; tempstr = tempstr->next)
		if (NULL == tempstr->next)
			break;
	while (tempstr->next)
		tempstr = tempstr->next;
	tempstr->next = &S4;

	/* 10.4.2 step 9 */