From: Samuel Ortiz Date: Thu, 4 Oct 2012 22:37:22 +0000 (+0200) Subject: NFC: Avoid falling back to SYMM when sk is NULL X-Git-Tag: MMI-PSA29.97-13-9~15401^2~17^2~315^2~29 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a6a0915f8c2d794030097ebe0adb85ee904ebac3;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 --- 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) 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"); @@ -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);