]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - crypto/ecc.c
crypto: ecc - Fix NULL pointer deref. on no default_rng
[mirror_ubuntu-bionic-kernel.git] / crypto / ecc.c
index 633a9bcdc5746ae46845529d3fff02a0260e2e42..18f32f2a5e1c9a28bdda922316ea801b5c7392bd 100644 (file)
@@ -964,7 +964,7 @@ int ecc_gen_privkey(unsigned int curve_id, unsigned int ndigits, u64 *privkey)
         * DRBG with a security strength of 256.
         */
        if (crypto_get_default_rng())
-               err = -EFAULT;
+               return -EFAULT;
 
        err = crypto_rng_get_bytes(crypto_default_rng, (u8 *)priv, nbytes);
        crypto_put_default_rng();