Search Linux Wireless

[PATCH] NFC: Handle return value of skb_dequeue()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



skb_dequeue() will return NULL for an empty list or a pointer
to the head element.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@xxxxxxxxx>
---
 net/nfc/rawsock.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/nfc/rawsock.c b/net/nfc/rawsock.c
index e2188de..c6de1ac 100644
--- a/net/nfc/rawsock.c
+++ b/net/nfc/rawsock.c
@@ -201,6 +201,10 @@ static void rawsock_tx_work(struct work_struct *work)
 	}
 
 	skb = skb_dequeue(&sk->sk_write_queue);
+	if (!skb) {
+		rawsock_write_queue_purge(sk);
+		return;
+	}
 
 	sock_hold(sk);
 	rc = nfc_data_exchange(dev, target_idx, skb,
-- 
2.7.4




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux