Bluetooth: Fix return value when bt_skb_alloc fails
authorGustavo F. Padovan <padovan@profusion.mobi>
Sat, 1 May 2010 19:15:34 +0000 (16:15 -0300)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 10 May 2010 07:28:45 +0000 (09:28 +0200)
Set the proper error(ENOMEM), instead of just return 0.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/hci_h4.c
drivers/bluetooth/hci_ll.c

index c0ce8134814e161e5da0b9f59635b9ce26e21983..3f038f5308a46064217b971f1f5cc6818d625553 100644 (file)
@@ -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;
index 5c65014635bee18b493870f3a70b94b03b652df2..91e44df844862b6aaee3046796382a6baf1807b5 100644 (file)
@@ -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;