Skip to content

Commit

Permalink
net: qrtr: Simplify 'qrtr_tun_release()'
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christophe JAILLET authored and David S. Miller committed Oct 31, 2019
1 parent dba7bf0 commit 21d8bd1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions net/qrtr/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 21d8bd1

Please sign in to comment.