diff options
Diffstat (limited to 'net/socket.c')
-rw-r--r-- | net/socket.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/socket.c b/net/socket.c index ee0d029e5130..88f759adf3af 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -369,16 +369,15 @@ struct file *sock_alloc_file(struct socket *sock, int flags, const char *dname) | |||
369 | 369 | ||
370 | file = alloc_file(&path, FMODE_READ | FMODE_WRITE, | 370 | file = alloc_file(&path, FMODE_READ | FMODE_WRITE, |
371 | &socket_file_ops); | 371 | &socket_file_ops); |
372 | if (unlikely(!file)) { | 372 | if (unlikely(IS_ERR(file))) { |
373 | /* drop dentry, keep inode */ | 373 | /* drop dentry, keep inode */ |
374 | ihold(path.dentry->d_inode); | 374 | ihold(path.dentry->d_inode); |
375 | path_put(&path); | 375 | path_put(&path); |
376 | return ERR_PTR(-ENFILE); | 376 | return file; |
377 | } | 377 | } |
378 | 378 | ||
379 | sock->file = file; | 379 | sock->file = file; |
380 | file->f_flags = O_RDWR | (flags & O_NONBLOCK); | 380 | file->f_flags = O_RDWR | (flags & O_NONBLOCK); |
381 | file->f_pos = 0; | ||
382 | file->private_data = sock; | 381 | file->private_data = sock; |
383 | return file; | 382 | return file; |
384 | } | 383 | } |