Commit 87c85b43 authored by David S. Miller's avatar David S. Miller

Read lock around files->fd[] accesses.

parent 57848f98
......@@ -289,11 +289,15 @@ static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg)
{
struct inode *ino;
/* I wonder which of these tests are superfluous... --patrik */
read_lock(&current->files->file_lock);
if (! current->files->fd[fd] ||
! current->files->fd[fd]->f_dentry ||
! (ino = current->files->fd[fd]->f_dentry->d_inode) ||
! ino->i_sock)
! ino->i_sock) {
read_unlock(&current->files->file_lock);
return TBADF;
}
read_unlock(&current->files->file_lock);
switch (cmd & 0xff) {
case 109: /* SI_SOCKPARAMS */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment