From: Gustavo F. Padovan Date: Sat, 1 May 2010 19:15:34 +0000 (-0300) Subject: Bluetooth: Fix return value when bt_skb_alloc fails X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=fe1aff710756ac73c455d214845c74e304d0e966;p=openwrt%2Fstaging%2Fblogic.git Bluetooth: Fix return value when bt_skb_alloc fails Set the proper error(ENOMEM), instead of just return 0. Signed-off-by: Gustavo F. Padovan Signed-off-by: Marcel Holtmann --- diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c index c0ce8134814e..3f038f5308a4 100644 --- a/drivers/bluetooth/hci_h4.c +++ b/drivers/bluetooth/hci_h4.c @@ -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"); h4->rx_state = H4_W4_PACKET_TYPE; h4->rx_count = 0; - return 0; + return -ENOMEM; } h4->rx_skb->dev = (void *) hu->hdev; diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c index 5c65014635be..91e44df84486 100644 --- a/drivers/bluetooth/hci_ll.c +++ b/drivers/bluetooth/hci_ll.c @@ -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"); ll->rx_state = HCILL_W4_PACKET_TYPE; ll->rx_count = 0; - return 0; + return -ENOMEM; } ll->rx_skb->dev = (void *) hu->hdev;