mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 09:10:28 +00:00
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:
parent
54ae1f3308
commit
1b96435a65
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=359570
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue