Avoid checking pointers that are never NULL.

Coverity noted that cod pointer is always non-NULL at the end of
cryptodev_aead().  While here, fix cryptodev_op() to match by making
one earlier failure case before cod and crp are allocated just return
directly.

CID:		1422185
Reported by:	Coverity
This commit is contained in:
jhb 2020-04-02 17:22:16 +00:00
parent 512a48dee1
commit 54906d4f65

View File

@ -915,8 +915,7 @@ cryptodev_op(
if (cop->mac && cse->hashsize == 0) {
SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__);
error = EINVAL;
goto bail;
return (EINVAL);
}
/*
@ -1091,10 +1090,8 @@ again:
}
bail:
if (crp)
crypto_freereq(crp);
if (cod)
cod_free(cod);
crypto_freereq(crp);
cod_free(cod);
return (error);
}
@ -1285,8 +1282,7 @@ again:
bail:
crypto_freereq(crp);
if (cod)
cod_free(cod);
cod_free(cod);
return (error);
}