Guard against NULL pointer dereference.

Reviewed by:	scottl
Approved by:	rwatson (mentor)
Sponsored by:	FreeBSD Foundation
Found with:	Coverity Prevent(tm)
CID:		130
This commit is contained in:
Edward Tomasz Napierala 2009-01-23 21:03:59 +00:00
parent eb322a6f77
commit 53f8b22b34
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=187649

View File

@ -171,6 +171,10 @@ cam_periph_alloc(periph_ctor_t *periph_ctor,
break;
}
xpt_unlock_buses();
if (p_drv == NULL) {
printf("cam_periph_alloc: invalid periph name '%s'\n", name);
return (CAM_REQ_INVALID);
}
sim = xpt_path_sim(path);
path_id = xpt_path_path_id(path);