Commit fe1aff71 authored by Gustavo F. Padovan's avatar Gustavo F. Padovan Committed by Marcel Holtmann

Bluetooth: Fix return value when bt_skb_alloc fails

Set the proper error(ENOMEM), instead of just return 0.
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 3ee94372
...@@ -246,7 +246,7 @@ static int h4_recv(struct hci_uart *hu, void *data, int count) ...@@ -246,7 +246,7 @@ static int h4_recv(struct hci_uart *hu, void *data, int count)
BT_ERR("Can't allocate mem for new packet"); BT_ERR("Can't allocate mem for new packet");
h4->rx_state = H4_W4_PACKET_TYPE; h4->rx_state = H4_W4_PACKET_TYPE;
h4->rx_count = 0; h4->rx_count = 0;
return 0; return -ENOMEM;
} }
h4->rx_skb->dev = (void *) hu->hdev; h4->rx_skb->dev = (void *) hu->hdev;
......
...@@ -491,7 +491,7 @@ static int ll_recv(struct hci_uart *hu, void *data, int count) ...@@ -491,7 +491,7 @@ static int ll_recv(struct hci_uart *hu, void *data, int count)
BT_ERR("Can't allocate mem for new packet"); BT_ERR("Can't allocate mem for new packet");
ll->rx_state = HCILL_W4_PACKET_TYPE; ll->rx_state = HCILL_W4_PACKET_TYPE;
ll->rx_count = 0; ll->rx_count = 0;
return 0; return -ENOMEM;
} }
ll->rx_skb->dev = (void *) hu->hdev; ll->rx_skb->dev = (void *) hu->hdev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment