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:
John Baldwin 2020-04-02 17:22:16 +00:00
parent 54ae1f3308
commit 1b96435a65
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=359570

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 @@ cryptodev_op(
}
bail:
if (crp)
crypto_freereq(crp);
if (cod)
cod_free(cod);
crypto_freereq(crp);
cod_free(cod);
return (error);
}
@ -1285,8 +1282,7 @@ cryptodev_aead(
bail:
crypto_freereq(crp);
if (cod)
cod_free(cod);
cod_free(cod);
return (error);
}