]> git.hungrycats.org Git - linux/commitdiff
[IRDA]: Fix SKB leaks.
authorJean Tourrilhes <jt@bougret.hpl.hp.com>
Tue, 25 Nov 2003 10:53:30 +0000 (02:53 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 25 Nov 2003 10:53:30 +0000 (02:53 -0800)
Do not special case ENOMEM as an error code, we should free up
the packet for all errors.

net/irda/irttp.c

index b1d57dfd2e8a42ffcb5c01f9d301c7a7ec434e9f..1f01ae13fe6f359af1c418bc216f8c2f4a2cf575 100644 (file)
@@ -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 */