diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2019-10-30 07:36:40 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-10-30 17:58:23 -0700 |
commit | 21d8bd123ac4f2223728901f0f26c90d1cbd42e3 (patch) | |
tree | 875a509d2b6c70a50f1098e37bab82486dc56e42 /net/qrtr | |
parent | dba7bf0348e47c2adc2994e811473ef3cd216e3b (diff) |
net: qrtr: Simplify 'qrtr_tun_release()'
Use 'skb_queue_purge()' instead of re-implementing it.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/qrtr')
-rw-r--r-- | net/qrtr/tun.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/net/qrtr/tun.c b/net/qrtr/tun.c index e35869e81766..15ce9b642b25 100644 --- a/net/qrtr/tun.c +++ b/net/qrtr/tun.c @@ -111,15 +111,11 @@ static __poll_t qrtr_tun_poll(struct file *filp, poll_table *wait) static int qrtr_tun_release(struct inode *inode, struct file *filp) { struct qrtr_tun *tun = filp->private_data; - struct sk_buff *skb; qrtr_endpoint_unregister(&tun->ep); /* Discard all SKBs */ - while (!skb_queue_empty(&tun->queue)) { - skb = skb_dequeue(&tun->queue); - kfree_skb(skb); - } + skb_queue_purge(&tun->queue); kfree(tun); |