Skip to content

Commit

Permalink
crypto: testmgr - Fix error flow of test_comp
Browse files Browse the repository at this point in the history
This warning:

  crypto/testmgr.c: In function ‘test_comp’:
  crypto/testmgr.c:829: warning: ‘ret’ may be used uninitialized in this function

triggers because GCC correctly notices that in the ctcount == 0 &&
dtcount != 0 input condition case this function can return an undefined
value, if the second loop fails.

Remove the shadowed 'ret' variable from the second loop that was probably
unintended.

Signed-off-by: Ingo Molnar <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
Ingo Molnar authored and herbertx committed Dec 25, 2008
1 parent 5f459f0 commit 664134d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/testmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ static int test_comp(struct crypto_comp *tfm, struct comp_testvec *ctemplate,
}

for (i = 0; i < dtcount; i++) {
int ilen, ret, dlen = COMP_BUF_SIZE;
int ilen, dlen = COMP_BUF_SIZE;

memset(result, 0, sizeof (result));

Expand Down

0 comments on commit 664134d

Please sign in to comment.