linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergio Paracuellos <sergio.paracuellos@gmail.com>
To: gregkh@linuxfoundation.org
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH 04/11] staging: wlan-ng: replace BUG_ON() into WARN_ON() on hfa384x_usbin_callback
Date: Mon,  7 Nov 2016 18:55:21 +0100	[thread overview]
Message-ID: <1478541328-2214-5-git-send-email-sergio.paracuellos@gmail.com> (raw)
In-Reply-To: <1478541328-2214-1-git-send-email-sergio.paracuellos@gmail.com>

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>
---
 drivers/staging/wlan-ng/hfa384x_usb.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index d234ed76..349f122 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -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;
 
-- 
1.9.1

  parent reply	other threads:[~2016-11-07 17:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-07 17:55 [PATCH 00/11] staging: wlan-ng: fix some style issues Sergio Paracuellos
2016-11-07 17:55 ` [PATCH 01/11] staging: wlan-ng: fix line style issue in macro WLAN_GET_FC_FSTYPE Sergio Paracuellos
2016-11-07 18:57   ` Joe Perches
2016-11-08  5:35     ` Sergio Paracuellos
2016-11-10  7:26       ` Greg KH
2016-11-07 17:55 ` [PATCH 02/11] staging: wlan-ng: remove unnecessary out of memory message in p80211conv.c Sergio Paracuellos
2016-11-07 17:55 ` [PATCH 03/11] staging: wlan-ng: remove unnecessary parenthesis in hfa384x_usb.c Sergio Paracuellos
2016-11-07 17:55 ` Sergio Paracuellos [this message]
2016-11-07 17:55 ` [PATCH 05/11] staging: wlan-ng: match open parenthesis alignment " Sergio Paracuellos
2016-11-07 17:55 ` [PATCH 06/11] staging: wlan-ng: match open parenthesis alignment in p80211req.c Sergio Paracuellos
2016-11-07 17:55 ` [PATCH 07/11] staging: wlan-ng: change comparison to NULL to preferred style Sergio Paracuellos
2016-11-07 17:55 ` [PATCH 08/11] staging: wlan-ng: remove unnecessary blank lines in p80211wep.c Sergio Paracuellos
2016-11-07 17:55 ` [PATCH 09/11] staging: wlan-ng: fix parenthesis alignment in prism2fw.c Sergio Paracuellos
2016-11-07 17:55 ` [PATCH 10/11] staging: wlan-ng: remove unnecessary blank lines " Sergio Paracuellos
2016-11-07 17:55 ` [PATCH 11/11] staging: wlan-ng: remove unnecessary parenthesis " Sergio Paracuellos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1478541328-2214-5-git-send-email-sergio.paracuellos@gmail.com \
    --to=sergio.paracuellos@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).