diff options
Diffstat (limited to 'drivers/bluetooth/hci_h5.c')
| -rw-r--r-- | drivers/bluetooth/hci_h5.c | 13 | 
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c index b6154d5a07a..fede8ca7147 100644 --- a/drivers/bluetooth/hci_h5.c +++ b/drivers/bluetooth/hci_h5.c @@ -206,12 +206,12 @@ static int h5_close(struct hci_uart *hu)  {  	struct h5 *h5 = hu->priv; +	del_timer_sync(&h5->timer); +  	skb_queue_purge(&h5->unack);  	skb_queue_purge(&h5->rel);  	skb_queue_purge(&h5->unrel); -	del_timer(&h5->timer); -  	kfree(h5);  	return 0; @@ -340,7 +340,7 @@ static void h5_complete_rx_pkt(struct hci_uart *hu)  		/* Remove Three-wire header */  		skb_pull(h5->rx_skb, 4); -		hci_recv_frame(h5->rx_skb); +		hci_recv_frame(hu->hdev, h5->rx_skb);  		h5->rx_skb = NULL;  		break; @@ -406,6 +406,7 @@ static int h5_rx_3wire_hdr(struct hci_uart *hu, unsigned char c)  	    H5_HDR_PKT_TYPE(hdr) != HCI_3WIRE_LINK_PKT) {  		BT_ERR("Non-link packet received in non-active state");  		h5_reset_rx(h5); +		return 0;  	}  	h5->rx_func = h5_rx_payload; @@ -673,7 +674,8 @@ static struct sk_buff *h5_dequeue(struct hci_uart *hu)  		return h5_prepare_pkt(hu, HCI_3WIRE_LINK_PKT, wakeup_req, 2);  	} -	if ((skb = skb_dequeue(&h5->unrel)) != NULL) { +	skb = skb_dequeue(&h5->unrel); +	if (skb != NULL) {  		nskb = h5_prepare_pkt(hu, bt_cb(skb)->pkt_type,  				      skb->data, skb->len);  		if (nskb) { @@ -690,7 +692,8 @@ static struct sk_buff *h5_dequeue(struct hci_uart *hu)  	if (h5->unack.qlen >= h5->tx_win)  		goto unlock; -	if ((skb = skb_dequeue(&h5->rel)) != NULL) { +	skb = skb_dequeue(&h5->rel); +	if (skb != NULL) {  		nskb = h5_prepare_pkt(hu, bt_cb(skb)->pkt_type,  				      skb->data, skb->len);  		if (nskb) {  | 
