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

Spotted by:	Coverity (via pjd)
MFC after:	1 week
This commit is contained in:
Philip Paeps 2008-11-17 19:00:36 +00:00
parent f6d2be2556
commit 2bc989be4f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=185026

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;
}