Protect against a possible NULL deference from an accessor

function.

Obtained from:	Netflix
This commit is contained in:
Scott Long 2018-01-09 00:00:55 +00:00
parent 78f57a9cde
commit 329e7a8b51
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=327709

View File

@ -202,7 +202,10 @@ int cam_periph_error(union ccb *ccb, cam_flags camflags,
static __inline struct mtx *
cam_periph_mtx(struct cam_periph *periph)
{
return (xpt_path_mtx(periph->path));
if (periph != NULL)
return (xpt_path_mtx(periph->path));
else
return (NULL);
}
#define cam_periph_owned(periph) \