diff options
| author | Marcel Holtmann <marcel@holtmann.org> | 2013-10-11 10:00:57 -0400 |
|---|---|---|
| committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-11 10:52:37 -0400 |
| commit | aae26277121a99509300c8024cf88d313f18f367 (patch) | |
| tree | f5da7a2afaeefb227816501fb97716494f4b0f2a | |
| parent | 7bd8f09f69f8a190f9b8334a07bb0a9237612314 (diff) | |
Bluetooth: Remove pointless parameter check in bfusb_send_frame()
The hdev parameter of bfusb_send_frame() is always valid. If it were
not valid, then it would have crashed earlier in the call chain.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| -rw-r--r-- | drivers/bluetooth/bfusb.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c index a6758490fa61..cce23041118f 100644 --- a/drivers/bluetooth/bfusb.c +++ b/drivers/bluetooth/bfusb.c | |||
| @@ -466,23 +466,16 @@ static int bfusb_close(struct hci_dev *hdev) | |||
| 466 | 466 | ||
| 467 | static int bfusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb) | 467 | static int bfusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb) |
| 468 | { | 468 | { |
| 469 | struct bfusb_data *data; | 469 | struct bfusb_data *data = hci_get_drvdata(hdev); |
| 470 | struct sk_buff *nskb; | 470 | struct sk_buff *nskb; |
| 471 | unsigned char buf[3]; | 471 | unsigned char buf[3]; |
| 472 | int sent = 0, size, count; | 472 | int sent = 0, size, count; |
| 473 | 473 | ||
| 474 | BT_DBG("hdev %p skb %p type %d len %d", hdev, skb, bt_cb(skb)->pkt_type, skb->len); | 474 | BT_DBG("hdev %p skb %p type %d len %d", hdev, skb, bt_cb(skb)->pkt_type, skb->len); |
| 475 | 475 | ||
| 476 | if (!hdev) { | ||
| 477 | BT_ERR("Frame for unknown HCI device (hdev=NULL)"); | ||
| 478 | return -ENODEV; | ||
| 479 | } | ||
| 480 | |||
| 481 | if (!test_bit(HCI_RUNNING, &hdev->flags)) | 476 | if (!test_bit(HCI_RUNNING, &hdev->flags)) |
| 482 | return -EBUSY; | 477 | return -EBUSY; |
| 483 | 478 | ||
| 484 | data = hci_get_drvdata(hdev); | ||
| 485 | |||
| 486 | switch (bt_cb(skb)->pkt_type) { | 479 | switch (bt_cb(skb)->pkt_type) { |
| 487 | case HCI_COMMAND_PKT: | 480 | case HCI_COMMAND_PKT: |
| 488 | hdev->stat.cmd_tx++; | 481 | hdev->stat.cmd_tx++; |
