Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: Remove pointless parameter check in vhci_send_frame()

The hdev parameter of vhci_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>

authored by

Marcel Holtmann and committed by
Johan Hedberg
60298775 52bc423a

+1 -8
+1 -8
drivers/bluetooth/hci_vhci.c
··· 83 83 84 84 static int vhci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) 85 85 { 86 - struct vhci_data *data; 87 - 88 - if (!hdev) { 89 - BT_ERR("Frame for unknown HCI device (hdev=NULL)"); 90 - return -ENODEV; 91 - } 86 + struct vhci_data *data = hci_get_drvdata(hdev); 92 87 93 88 if (!test_bit(HCI_RUNNING, &hdev->flags)) 94 89 return -EBUSY; 95 - 96 - data = hci_get_drvdata(hdev); 97 90 98 91 memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1); 99 92 skb_queue_tail(&data->readq, skb);