Bluetooth: 6lowpan: Don't drop packets when run out of credits
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 11 Apr 2017 19:20:59 +0000 (22:20 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 12 Apr 2017 20:02:40 +0000 (22:02 +0200)
Since l2cap_chan_send will now queue the packets there is no point in
checking the credits anymore.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/6lowpan.c

index 5b91e85cf1c69078975c8776a14d2594421dc303..22bd936ed2cec4b3d9b90f81668cf851cadf6904 100644 (file)
@@ -478,15 +478,8 @@ static int send_pkt(struct l2cap_chan *chan, struct sk_buff *skb,
                return 0;
        }
 
-       if (!err)
-               err = (!chan->tx_credits ? -EAGAIN : 0);
-
-       if (err < 0) {
-               if (err == -EAGAIN)
-                       netdev->stats.tx_dropped++;
-               else
-                       netdev->stats.tx_errors++;
-       }
+       if (err < 0)
+               netdev->stats.tx_errors++;
 
        return err;
 }