aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/bluetooth/6lowpan.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index fcfaa7006b28..c2e0d14433df 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -546,11 +546,12 @@ static int send_pkt(struct l2cap_chan *chan, struct sk_buff *skb,
546 return err; 546 return err;
547} 547}
548 548
549static void send_mcast_pkt(struct sk_buff *skb, struct net_device *netdev) 549static int send_mcast_pkt(struct sk_buff *skb, struct net_device *netdev)
550{ 550{
551 struct sk_buff *local_skb; 551 struct sk_buff *local_skb;
552 struct lowpan_dev *entry, *tmp; 552 struct lowpan_dev *entry, *tmp;
553 unsigned long flags; 553 unsigned long flags;
554 int err = 0;
554 555
555 read_lock_irqsave(&devices_lock, flags); 556 read_lock_irqsave(&devices_lock, flags);
556 557
@@ -564,19 +565,25 @@ static void send_mcast_pkt(struct sk_buff *skb, struct net_device *netdev)
564 dev = lowpan_dev(entry->netdev); 565 dev = lowpan_dev(entry->netdev);
565 566
566 list_for_each_entry_safe(pentry, ptmp, &dev->peers, list) { 567 list_for_each_entry_safe(pentry, ptmp, &dev->peers, list) {
568 int ret;
569
567 local_skb = skb_clone(skb, GFP_ATOMIC); 570 local_skb = skb_clone(skb, GFP_ATOMIC);
568 571
569 BT_DBG("xmit %s to %pMR type %d IP %pI6c chan %p", 572 BT_DBG("xmit %s to %pMR type %d IP %pI6c chan %p",
570 netdev->name, 573 netdev->name,
571 &pentry->chan->dst, pentry->chan->dst_type, 574 &pentry->chan->dst, pentry->chan->dst_type,
572 &pentry->peer_addr, pentry->chan); 575 &pentry->peer_addr, pentry->chan);
573 send_pkt(pentry->chan, local_skb, netdev); 576 ret = send_pkt(pentry->chan, local_skb, netdev);
577 if (ret < 0)
578 err = ret;
574 579
575 kfree_skb(local_skb); 580 kfree_skb(local_skb);
576 } 581 }
577 } 582 }
578 583
579 read_unlock_irqrestore(&devices_lock, flags); 584 read_unlock_irqrestore(&devices_lock, flags);
585
586 return err;
580} 587}
581 588
582static netdev_tx_t bt_xmit(struct sk_buff *skb, struct net_device *netdev) 589static netdev_tx_t bt_xmit(struct sk_buff *skb, struct net_device *netdev)
@@ -620,7 +627,7 @@ static netdev_tx_t bt_xmit(struct sk_buff *skb, struct net_device *netdev)
620 /* We need to send the packet to every device behind this 627 /* We need to send the packet to every device behind this
621 * interface. 628 * interface.
622 */ 629 */
623 send_mcast_pkt(skb, netdev); 630 err = send_mcast_pkt(skb, netdev);
624 } 631 }
625 632
626 dev_kfree_skb(skb); 633 dev_kfree_skb(skb);