aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/solaris/ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/solaris/ioctl.c')
-rw-r--r--arch/sparc64/solaris/ioctl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/sparc64/solaris/ioctl.c b/arch/sparc64/solaris/ioctl.c
index cac0a1cf0050..374766455f5e 100644
--- a/arch/sparc64/solaris/ioctl.c
+++ b/arch/sparc64/solaris/ioctl.c
@@ -293,11 +293,13 @@ static struct module_info {
293static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg) 293static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg)
294{ 294{
295 struct inode *ino; 295 struct inode *ino;
296 struct fdtable *fdt;
296 /* I wonder which of these tests are superfluous... --patrik */ 297 /* I wonder which of these tests are superfluous... --patrik */
297 spin_lock(&current->files->file_lock); 298 spin_lock(&current->files->file_lock);
298 if (! current->files->fd[fd] || 299 fdt = files_fdtable(current->files);
299 ! current->files->fd[fd]->f_dentry || 300 if (! fdt->fd[fd] ||
300 ! (ino = current->files->fd[fd]->f_dentry->d_inode) || 301 ! fdt->fd[fd]->f_dentry ||
302 ! (ino = fdt->fd[fd]->f_dentry->d_inode) ||
301 ! S_ISSOCK(ino->i_mode)) { 303 ! S_ISSOCK(ino->i_mode)) {
302 spin_unlock(&current->files->file_lock); 304 spin_unlock(&current->files->file_lock);
303 return TBADF; 305 return TBADF;