Skip to content

Commit 2024e7d

Browse files
RoelKluinherbertx
authored andcommitted
crypto: ansi_cprng - Fix test in get_prng_bytes
size_t nbytes cannot be less than 0 and the test was redundant. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 8ffd1be commit 2024e7d

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

‎crypto/ansi_cprng.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,6 @@ static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx,
193193
int err;
194194

195195

196-
if (nbytes < 0)
197-
return -EINVAL;
198-
199196
spin_lock_bh(&ctx->prng_lock);
200197

201198
err = -EINVAL;

0 commit comments

Comments
 (0)