diff options
author | Roar Førde <roar.forde@stericsson.com> | 2011-12-06 16:15:44 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-07 02:21:47 +0400 |
commit | f84ea779c25dabc90956f1c329e5e5c501ea96cc (patch) | |
tree | 8a66cb38fb4f7d04bf5a1c3405c73802eaac0614 /drivers/net/caif | |
parent | 095d2a71e51bd2a3e476232156e8d9c2dbc0596d (diff) | |
download | linux-f84ea779c25dabc90956f1c329e5e5c501ea96cc.tar.xz |
caif: Replace BUG_ON with WARN_ON.
BUG_ON is too strict in a number of circumstances,
use WARN_ON instead. Protocol errors should not halt the system.
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/caif')
-rw-r--r-- | drivers/net/caif/caif_hsi.c | 2 | ||||
-rw-r--r-- | drivers/net/caif/caif_serial.c | 4 | ||||
-rw-r--r-- | drivers/net/caif/caif_shmcore.c | 6 |
3 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c index a85b29e797f0..0a4fc62a381d 100644 --- a/drivers/net/caif/caif_hsi.c +++ b/drivers/net/caif/caif_hsi.c @@ -933,7 +933,7 @@ static int cfhsi_xmit(struct sk_buff *skb, struct net_device *dev) /* Create HSI frame. */ len = cfhsi_tx_frm(desc, cfhsi); - BUG_ON(!len); + WARN_ON(!len); /* Set up new transfer. */ res = cfhsi->dev->cfhsi_tx(cfhsi->tx_buf, len, cfhsi->dev); diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c index 23406e62c0b0..9341a2d6efee 100644 --- a/drivers/net/caif/caif_serial.c +++ b/drivers/net/caif/caif_serial.c @@ -261,7 +261,7 @@ static int handle_tx(struct ser_device *ser) skb_pull(skb, tty_wr); if (skb->len == 0) { struct sk_buff *tmp = skb_dequeue(&ser->head); - BUG_ON(tmp != skb); + WARN_ON(tmp != skb); if (in_interrupt()) dev_kfree_skb_irq(skb); else @@ -305,7 +305,7 @@ static void ldisc_tx_wakeup(struct tty_struct *tty) ser = tty->disc_data; BUG_ON(ser == NULL); - BUG_ON(ser->tty != tty); + WARN_ON(ser->tty != tty); handle_tx(ser); } diff --git a/drivers/net/caif/caif_shmcore.c b/drivers/net/caif/caif_shmcore.c index fd59e37e28a1..5b2041319a32 100644 --- a/drivers/net/caif/caif_shmcore.c +++ b/drivers/net/caif/caif_shmcore.c @@ -337,7 +337,11 @@ static void shm_rx_work_func(struct work_struct *rx_work) /* Get a suitable CAIF packet and copy in data. */ skb = netdev_alloc_skb(pshm_drv->pshm_dev->pshm_netdev, frm_pck_len + 1); - BUG_ON(skb == NULL); + + if (skb == NULL) { + pr_info("OOM: Try next frame in descriptor\n"); + break; + } p = skb_put(skb, frm_pck_len); memcpy(p, pbuf->desc_vptr + frm_pck_ofs, frm_pck_len); |