Skip to content

Commit

Permalink
NFC: Avoid falling back to SYMM when sk is NULL
Browse files Browse the repository at this point in the history
In some cases (SNL, DISC, DM) we need to send an LLCP skbs without
having a sock owning it. I frames are an exception here since
they may be requeued to the llcp_sock queue.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Samuel Ortiz committed Oct 26, 2012
1 parent 97f1841 commit a6a0915
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions net/nfc/llcp/llcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,10 @@ static void nfc_llcp_tx_work(struct work_struct *work)
if (skb != NULL) {
sk = skb->sk;
llcp_sock = nfc_llcp_sock(sk);
if (llcp_sock != NULL) {

if (llcp_sock == NULL && nfc_llcp_ptype(skb) == LLCP_PDU_I) {
nfc_llcp_send_symm(local->dev);
} else {
int ret;

pr_debug("Sending pending skb\n");
Expand All @@ -629,8 +632,6 @@ static void nfc_llcp_tx_work(struct work_struct *work)
skb_queue_tail(&llcp_sock->tx_pending_queue,
skb);
}
} else {
nfc_llcp_send_symm(local->dev);
}
} else {
nfc_llcp_send_symm(local->dev);
Expand Down

0 comments on commit a6a0915

Please sign in to comment.