Commit 873fba1b authored by Jean Tourrilhes's avatar Jean Tourrilhes Committed by Linus Torvalds

[IRDA]: Fix SKB leaks.

Do not special case ENOMEM as an error code, we should free up
the packet for all errors.
parent 5d9ff6d0
......@@ -859,10 +859,10 @@ static int irttp_udata_indication(void *instance, void *sap,
err = self->notify.udata_indication(self->notify.instance,
self,skb);
/* Same comment as in irttp_do_data_indication() */
if (err != -ENOMEM)
if (!err)
return 0;
}
/* Either no handler, or -ENOMEM */
/* Either no handler, or handler returns an error */
dev_kfree_skb(skb);
return 0;
......@@ -1620,7 +1620,7 @@ void irttp_do_data_indication(struct tsap_cb *self, struct sk_buff *skb)
* be difficult, so it can instead just refuse to eat it and just
* give an error back
*/
if (err == -ENOMEM) {
if (err) {
IRDA_DEBUG(0, "%s() requeueing skb!\n", __FUNCTION__);
/* Make sure we take a break */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment