File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -157,26 +157,24 @@ int handshake_nl_accept_doit(struct sk_buff *skb, struct genl_info *info)
157
157
int handshake_nl_done_doit (struct sk_buff * skb , struct genl_info * info )
158
158
{
159
159
struct net * net = sock_net (skb -> sk );
160
- struct handshake_req * req = NULL ;
161
- struct socket * sock = NULL ;
160
+ struct handshake_req * req ;
161
+ struct socket * sock ;
162
162
int fd , status , err ;
163
163
164
164
if (GENL_REQ_ATTR_CHECK (info , HANDSHAKE_A_DONE_SOCKFD ))
165
165
return - EINVAL ;
166
166
fd = nla_get_u32 (info -> attrs [HANDSHAKE_A_DONE_SOCKFD ]);
167
167
168
- err = 0 ;
169
168
sock = sockfd_lookup (fd , & err );
170
- if (err ) {
171
- err = - EBADF ;
172
- goto out_status ;
173
- }
169
+ if (!sock )
170
+ return err ;
174
171
175
172
req = handshake_req_hash_lookup (sock -> sk );
176
173
if (!req ) {
177
174
err = - EBUSY ;
175
+ trace_handshake_cmd_done_err (net , req , sock -> sk , err );
178
176
fput (sock -> file );
179
- goto out_status ;
177
+ return err ;
180
178
}
181
179
182
180
trace_handshake_cmd_done (net , req , sock -> sk , fd );
@@ -188,10 +186,6 @@ int handshake_nl_done_doit(struct sk_buff *skb, struct genl_info *info)
188
186
handshake_complete (req , status , info );
189
187
fput (sock -> file );
190
188
return 0 ;
191
-
192
- out_status :
193
- trace_handshake_cmd_done_err (net , req , sock -> sk , err );
194
- return err ;
195
189
}
196
190
197
191
static unsigned int handshake_net_id ;
You can’t perform that action at this time.
0 commit comments