Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
3bbc0ceb
Commit
3bbc0ceb
authored
Feb 21, 2013
by
Samuel Ortiz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFC: llcp: Report error to pending sockets when a device is removed
Signed-off-by:
Samuel Ortiz
<
sameo@linux.intel.com
>
parent
e6a3a4bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
net/nfc/llcp/llcp.c
net/nfc/llcp/llcp.c
+12
-4
No files found.
net/nfc/llcp/llcp.c
View file @
3bbc0ceb
...
@@ -68,7 +68,8 @@ static void nfc_llcp_socket_purge(struct nfc_llcp_sock *sock)
...
@@ -68,7 +68,8 @@ static void nfc_llcp_socket_purge(struct nfc_llcp_sock *sock)
}
}
}
}
static
void
nfc_llcp_socket_release
(
struct
nfc_llcp_local
*
local
,
bool
listen
)
static
void
nfc_llcp_socket_release
(
struct
nfc_llcp_local
*
local
,
bool
listen
,
int
err
)
{
{
struct
sock
*
sk
;
struct
sock
*
sk
;
struct
hlist_node
*
tmp
;
struct
hlist_node
*
tmp
;
...
@@ -100,7 +101,10 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen)
...
@@ -100,7 +101,10 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen)
nfc_llcp_accept_unlink
(
accept_sk
);
nfc_llcp_accept_unlink
(
accept_sk
);
if
(
err
)
accept_sk
->
sk_err
=
err
;
accept_sk
->
sk_state
=
LLCP_CLOSED
;
accept_sk
->
sk_state
=
LLCP_CLOSED
;
accept_sk
->
sk_state_change
(
sk
);
bh_unlock_sock
(
accept_sk
);
bh_unlock_sock
(
accept_sk
);
...
@@ -123,7 +127,10 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen)
...
@@ -123,7 +127,10 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen)
continue
;
continue
;
}
}
if
(
err
)
sk
->
sk_err
=
err
;
sk
->
sk_state
=
LLCP_CLOSED
;
sk
->
sk_state
=
LLCP_CLOSED
;
sk
->
sk_state_change
(
sk
);
bh_unlock_sock
(
sk
);
bh_unlock_sock
(
sk
);
...
@@ -150,8 +157,9 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen)
...
@@ -150,8 +157,9 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen)
nfc_llcp_socket_purge
(
llcp_sock
);
nfc_llcp_socket_purge
(
llcp_sock
);
if
(
err
)
sk
->
sk_err
=
err
;
sk
->
sk_state
=
LLCP_CLOSED
;
sk
->
sk_state
=
LLCP_CLOSED
;
sk
->
sk_state_change
(
sk
);
sk
->
sk_state_change
(
sk
);
bh_unlock_sock
(
sk
);
bh_unlock_sock
(
sk
);
...
@@ -173,7 +181,7 @@ struct nfc_llcp_local *nfc_llcp_local_get(struct nfc_llcp_local *local)
...
@@ -173,7 +181,7 @@ struct nfc_llcp_local *nfc_llcp_local_get(struct nfc_llcp_local *local)
static
void
local_cleanup
(
struct
nfc_llcp_local
*
local
,
bool
listen
)
static
void
local_cleanup
(
struct
nfc_llcp_local
*
local
,
bool
listen
)
{
{
nfc_llcp_socket_release
(
local
,
listen
);
nfc_llcp_socket_release
(
local
,
listen
,
ENXIO
);
del_timer_sync
(
&
local
->
link_timer
);
del_timer_sync
(
&
local
->
link_timer
);
skb_queue_purge
(
&
local
->
tx_queue
);
skb_queue_purge
(
&
local
->
tx_queue
);
cancel_work_sync
(
&
local
->
tx_work
);
cancel_work_sync
(
&
local
->
tx_work
);
...
@@ -1382,7 +1390,7 @@ void nfc_llcp_mac_is_down(struct nfc_dev *dev)
...
@@ -1382,7 +1390,7 @@ void nfc_llcp_mac_is_down(struct nfc_dev *dev)
return
;
return
;
/* Close and purge all existing sockets */
/* Close and purge all existing sockets */
nfc_llcp_socket_release
(
local
,
true
);
nfc_llcp_socket_release
(
local
,
true
,
0
);
}
}
void
nfc_llcp_mac_is_up
(
struct
nfc_dev
*
dev
,
u32
target_idx
,
void
nfc_llcp_mac_is_up
(
struct
nfc_dev
*
dev
,
u32
target_idx
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment