goto fail;
}
+ /*
+ * In case of an error, crypto_alloc_acomp_node() returns an
+ * error pointer, never NULL.
+ */
acomp = crypto_alloc_acomp_node(pool->tfm_name, 0, 0, cpu_to_node(cpu));
if (IS_ERR(acomp)) {
pr_err("could not alloc crypto acomp %s : %pe\n",
goto fail;
}
+ /* acomp_request_alloc() returns NULL in case of an error. */
req = acomp_request_alloc(acomp);
if (!req) {
pr_err("could not alloc crypto acomp_request %s\n",
struct crypto_acomp *acomp;
u8 *buffer;
- if (IS_ERR_OR_NULL(acomp_ctx))
+ if (!acomp_ctx)
return 0;
mutex_lock(&acomp_ctx->mutex);
/*
* Do the actual freeing after releasing the mutex to avoid subtle
* locking dependencies causing deadlocks.
+ *
+ * If there was an error in allocating @acomp_ctx->req, it
+ * would be set to NULL.
*/
- if (!IS_ERR_OR_NULL(req))
+ if (req)
acomp_request_free(req);
if (!IS_ERR_OR_NULL(acomp))
crypto_free_acomp(acomp);