Fix a potential NULL-pointer dereference in padlock(4).
Spotted by: Coverity (via pjd) MFC after: 1 week
This commit is contained in:
parent
f6d2be2556
commit
2bc989be4f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=185026
@ -297,7 +297,11 @@ padlock_process(device_t dev, struct cryptop *crp, int hint __unused)
|
|||||||
|
|
||||||
enccrd = maccrd = NULL;
|
enccrd = maccrd = NULL;
|
||||||
|
|
||||||
if (crp == NULL || crp->crp_callback == NULL || crp->crp_desc == NULL) {
|
/* Sanity check. */
|
||||||
|
if (crp == NULL)
|
||||||
|
return (EINVAL);
|
||||||
|
|
||||||
|
if (crp->crp_callback == NULL || crp->crp_desc == NULL) {
|
||||||
error = EINVAL;
|
error = EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user