diff options
Diffstat (limited to 'fs/eventpoll.c')
-rw-r--r-- | fs/eventpoll.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 221086fef174..990c01d2d66b 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c | |||
@@ -1050,8 +1050,6 @@ asmlinkage long sys_epoll_create(int size) | |||
1050 | { | 1050 | { |
1051 | int error, fd = -1; | 1051 | int error, fd = -1; |
1052 | struct eventpoll *ep; | 1052 | struct eventpoll *ep; |
1053 | struct inode *inode; | ||
1054 | struct file *file; | ||
1055 | 1053 | ||
1056 | DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d)\n", | 1054 | DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d)\n", |
1057 | current, size)); | 1055 | current, size)); |
@@ -1061,29 +1059,24 @@ asmlinkage long sys_epoll_create(int size) | |||
1061 | * structure ( "struct eventpoll" ). | 1059 | * structure ( "struct eventpoll" ). |
1062 | */ | 1060 | */ |
1063 | error = -EINVAL; | 1061 | error = -EINVAL; |
1064 | if (size <= 0 || (error = ep_alloc(&ep)) != 0) | 1062 | if (size <= 0 || (error = ep_alloc(&ep)) < 0) { |
1063 | fd = error; | ||
1065 | goto error_return; | 1064 | goto error_return; |
1065 | } | ||
1066 | 1066 | ||
1067 | /* | 1067 | /* |
1068 | * Creates all the items needed to setup an eventpoll file. That is, | 1068 | * Creates all the items needed to setup an eventpoll file. That is, |
1069 | * a file structure, and inode and a free file descriptor. | 1069 | * a file structure and a free file descriptor. |
1070 | */ | 1070 | */ |
1071 | error = anon_inode_getfd(&fd, &inode, &file, "[eventpoll]", | 1071 | fd = anon_inode_getfd("[eventpoll]", &eventpoll_fops, ep); |
1072 | &eventpoll_fops, ep); | 1072 | if (fd < 0) |
1073 | if (error) | 1073 | ep_free(ep); |
1074 | goto error_free; | ||
1075 | 1074 | ||
1075 | error_return: | ||
1076 | DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d) = %d\n", | 1076 | DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d) = %d\n", |
1077 | current, size, fd)); | 1077 | current, size, fd)); |
1078 | 1078 | ||
1079 | return fd; | 1079 | return fd; |
1080 | |||
1081 | error_free: | ||
1082 | ep_free(ep); | ||
1083 | error_return: | ||
1084 | DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d) = %d\n", | ||
1085 | current, size, error)); | ||
1086 | return error; | ||
1087 | } | 1080 | } |
1088 | 1081 | ||
1089 | /* | 1082 | /* |