mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
rpmsg: char: Simplify 'rpmsg_eptdev_release()'
Use 'skb_queue_purge()' instead of re-implementing it. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
parent
278bcb7300
commit
bb06a5ce88
1 changed files with 1 additions and 5 deletions
|
@ -146,7 +146,6 @@ static int rpmsg_eptdev_release(struct inode *inode, struct file *filp)
|
|||
{
|
||||
struct rpmsg_eptdev *eptdev = cdev_to_eptdev(inode->i_cdev);
|
||||
struct device *dev = &eptdev->dev;
|
||||
struct sk_buff *skb;
|
||||
|
||||
/* Close the endpoint, if it's not already destroyed by the parent */
|
||||
mutex_lock(&eptdev->ept_lock);
|
||||
|
@ -157,10 +156,7 @@ static int rpmsg_eptdev_release(struct inode *inode, struct file *filp)
|
|||
mutex_unlock(&eptdev->ept_lock);
|
||||
|
||||
/* Discard all SKBs */
|
||||
while (!skb_queue_empty(&eptdev->queue)) {
|
||||
skb = skb_dequeue(&eptdev->queue);
|
||||
kfree_skb(skb);
|
||||
}
|
||||
skb_queue_purge(&eptdev->queue);
|
||||
|
||||
put_device(dev);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue