Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1145ce3 authored by Julia Lawall's avatar Julia Lawall Committed by Herbert Xu
Browse files

[CRYPTO] cryptd: Correct kzalloc error test



Normally, kzalloc returns NULL or a valid pointer value, not a value to be
tested using IS_ERR.

Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 46f8153c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -190,8 +190,10 @@ static struct crypto_instance *cryptd_alloc_instance(struct crypto_alg *alg,
	int err;

	inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL);
	if (IS_ERR(inst))
	if (!inst) {
		inst = ERR_PTR(-ENOMEM);
		goto out;
	}

	err = -ENAMETOOLONG;
	if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME,