Fix a potential NULL-pointer dereference in padlock(4).

Spotted by:	Coverity (via pjd)
MFC after:	1 week
This commit is contained in:
philip 2008-11-17 19:00:36 +00:00
parent ee3d6ade2e
commit f3d74d62d3

View File

@ -297,7 +297,11 @@ padlock_process(device_t dev, struct cryptop *crp, int hint __unused)
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;
goto out;
}