lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <8a2fd474b3c7a14e13852f0947544aad8f0ae169.1513453148.git.arvind.yadav.cs@gmail.com>
Date:   Sun, 17 Dec 2017 01:14:20 +0530
From:   Arvind Yadav <arvind.yadav.cs@...il.com>
To:     sameo@...ux.intel.com, davem@...emloft.net
Cc:     linux-kernel@...r.kernel.org, linux-wireless@...r.kernel.org,
        netdev@...r.kernel.org
Subject: [PATCH] NFC: Handle return value of skb_dequeue()

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

Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ