Эх сурвалжийг харах

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>
Roel Kluin 15 жил өмнө
parent
commit
2024e7d680
1 өөрчлөгдсөн 0 нэмэгдсэн , 3 устгасан
  1. 0 3
      crypto/ansi_cprng.c

+ 0 - 3
crypto/ansi_cprng.c

@@ -193,9 +193,6 @@ static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx,
 	int err;
 
 
-	if (nbytes < 0)
-		return -EINVAL;
-
 	spin_lock_bh(&ctx->prng_lock);
 
 	err = -EINVAL;