]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: wlan-ng: replace BUG_ON() into WARN_ON() on hfa384x_usbin_callback
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Mon, 7 Nov 2016 17:55:21 +0000 (18:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Nov 2016 12:25:32 +0000 (13:25 +0100)
This patch avoids using BUG_ON() from driver,
and return from hfa384x_usbin_callback with WARN_ON()
if skb was NULL or data in skb is different from expected one.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/hfa384x_usb.c

index d234ed76ab1a28af0f51c8a178768daae62d3153..349f12250d7733d8c0534d3af616d07fbcacb647 100644 (file)
@@ -3057,7 +3057,10 @@ static void hfa384x_usbin_callback(struct urb *urb)
                goto exit;
 
        skb = hw->rx_urb_skb;
-       BUG_ON(!skb || (skb->data != urb->transfer_buffer));
+       if (!skb || (skb->data != urb->transfer_buffer)) {
+               WARN_ON(1);
+               return;
+       }
 
        hw->rx_urb_skb = NULL;