Explicitly assert that the filedesc lock is held when the fget_locked()
function is called. MFC after: 1 month
This commit is contained in:
parent
b7fc69ca89
commit
7a4981c1f6
@ -142,7 +142,12 @@ static __inline struct file *
|
|||||||
fget_locked(struct filedesc *fdp, int fd)
|
fget_locked(struct filedesc *fdp, int fd)
|
||||||
{
|
{
|
||||||
|
|
||||||
return (fd < 0 || fd >= fdp->fd_nfiles ? NULL : fdp->fd_ofiles[fd]);
|
FILEDESC_LOCK_ASSERT(fdp);
|
||||||
|
|
||||||
|
if (fd < 0 || fd >= fdp->fd_nfiles)
|
||||||
|
return (NULL);
|
||||||
|
|
||||||
|
return (fdp->fd_ofiles[fd]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _KERNEL */
|
#endif /* _KERNEL */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user