diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2012-10-04 18:37:22 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-10-26 12:26:46 -0400 |
commit | a6a0915f8c2d794030097ebe0adb85ee904ebac3 (patch) | |
tree | f06d0bf7357ffc06fc44aa320155434aa98279da /net/nfc | |
parent | 97f18414af395c547f20300e5d4c81d7190a4155 (diff) |
NFC: Avoid falling back to SYMM when sk is NULL
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>
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/llcp/llcp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c index cc10d073c338..71cc8af097a4 100644 --- a/net/nfc/llcp/llcp.c +++ b/net/nfc/llcp/llcp.c | |||
@@ -610,7 +610,10 @@ static void nfc_llcp_tx_work(struct work_struct *work) | |||
610 | if (skb != NULL) { | 610 | if (skb != NULL) { |
611 | sk = skb->sk; | 611 | sk = skb->sk; |
612 | llcp_sock = nfc_llcp_sock(sk); | 612 | llcp_sock = nfc_llcp_sock(sk); |
613 | if (llcp_sock != NULL) { | 613 | |
614 | if (llcp_sock == NULL && nfc_llcp_ptype(skb) == LLCP_PDU_I) { | ||
615 | nfc_llcp_send_symm(local->dev); | ||
616 | } else { | ||
614 | int ret; | 617 | int ret; |
615 | 618 | ||
616 | pr_debug("Sending pending skb\n"); | 619 | pr_debug("Sending pending skb\n"); |
@@ -629,8 +632,6 @@ static void nfc_llcp_tx_work(struct work_struct *work) | |||
629 | skb_queue_tail(&llcp_sock->tx_pending_queue, | 632 | skb_queue_tail(&llcp_sock->tx_pending_queue, |
630 | skb); | 633 | skb); |
631 | } | 634 | } |
632 | } else { | ||
633 | nfc_llcp_send_symm(local->dev); | ||
634 | } | 635 | } |
635 | } else { | 636 | } else { |
636 | nfc_llcp_send_symm(local->dev); | 637 | nfc_llcp_send_symm(local->dev); |