diff options
author | Stephan Mueller <smueller@chronox.de> | 2014-06-23 03:11:29 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2014-06-26 02:46:31 -0400 |
commit | c0eedf803467620fd3bdafccdd761990f6bd42e1 (patch) | |
tree | 614b96364e374909364275a04b7fbb4a57e3ed1f /crypto/drbg.c | |
parent | de18cd4b71acecbd1278a7bb79340cbf885212aa (diff) |
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>
Diffstat (limited to 'crypto/drbg.c')
-rw-r--r-- | crypto/drbg.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crypto/drbg.c b/crypto/drbg.c index faaa2cefeeed..99fa8f89fb3e 100644 --- a/crypto/drbg.c +++ b/crypto/drbg.c | |||
@@ -516,13 +516,13 @@ static int drbg_ctr_df(struct drbg_state *drbg, | |||
516 | S2.next = addtl; | 516 | S2.next = addtl; |
517 | 517 | ||
518 | /* | 518 | /* |
519 | * splice in addtl between S2 and S4 -- we place S4 at the end of the | 519 | * Splice in addtl between S2 and S4 -- we place S4 at the end |
520 | * input data chain | 520 | * of the input data chain. As this code is only triggered when |
521 | * addtl is not NULL, no NULL checks are necessary. | ||
521 | */ | 522 | */ |
522 | tempstr = addtl; | 523 | tempstr = addtl; |
523 | for (; NULL != tempstr; tempstr = tempstr->next) | 524 | while (tempstr->next) |
524 | if (NULL == tempstr->next) | 525 | tempstr = tempstr->next; |
525 | break; | ||
526 | tempstr->next = &S4; | 526 | tempstr->next = &S4; |
527 | 527 | ||
528 | /* 10.4.2 step 9 */ | 528 | /* 10.4.2 step 9 */ |