diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/cmtp/core.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c index 42cb2f4c0db1..521baa4fe835 100644 --- a/net/bluetooth/cmtp/core.c +++ b/net/bluetooth/cmtp/core.c | |||
@@ -382,16 +382,17 @@ int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock) | |||
382 | 382 | ||
383 | if (!(session->flags & (1 << CMTP_LOOPBACK))) { | 383 | if (!(session->flags & (1 << CMTP_LOOPBACK))) { |
384 | err = cmtp_attach_device(session); | 384 | err = cmtp_attach_device(session); |
385 | if (err < 0) | 385 | if (err < 0) { |
386 | goto detach; | 386 | atomic_inc(&session->terminate); |
387 | wake_up_process(session->task); | ||
388 | up_write(&cmtp_session_sem); | ||
389 | return err; | ||
390 | } | ||
387 | } | 391 | } |
388 | 392 | ||
389 | up_write(&cmtp_session_sem); | 393 | up_write(&cmtp_session_sem); |
390 | return 0; | 394 | return 0; |
391 | 395 | ||
392 | detach: | ||
393 | cmtp_detach_device(session); | ||
394 | |||
395 | unlink: | 396 | unlink: |
396 | __cmtp_unlink_session(session); | 397 | __cmtp_unlink_session(session); |
397 | 398 | ||