aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/caif
diff options
context:
space:
mode:
authorRoar Førde <roar.forde@stericsson.com>2011-12-06 07:15:44 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-06 17:21:47 -0500
commitf84ea779c25dabc90956f1c329e5e5c501ea96cc (patch)
tree8a66cb38fb4f7d04bf5a1c3405c73802eaac0614 /drivers/net/caif
parent095d2a71e51bd2a3e476232156e8d9c2dbc0596d (diff)
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.c2
-rw-r--r--drivers/net/caif/caif_serial.c4
-rw-r--r--drivers/net/caif/caif_shmcore.c6
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)
933 933
934 /* Create HSI frame. */ 934 /* Create HSI frame. */
935 len = cfhsi_tx_frm(desc, cfhsi); 935 len = cfhsi_tx_frm(desc, cfhsi);
936 BUG_ON(!len); 936 WARN_ON(!len);
937 937
938 /* Set up new transfer. */ 938 /* Set up new transfer. */
939 res = cfhsi->dev->cfhsi_tx(cfhsi->tx_buf, len, cfhsi->dev); 939 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)
261 skb_pull(skb, tty_wr); 261 skb_pull(skb, tty_wr);
262 if (skb->len == 0) { 262 if (skb->len == 0) {
263 struct sk_buff *tmp = skb_dequeue(&ser->head); 263 struct sk_buff *tmp = skb_dequeue(&ser->head);
264 BUG_ON(tmp != skb); 264 WARN_ON(tmp != skb);
265 if (in_interrupt()) 265 if (in_interrupt())
266 dev_kfree_skb_irq(skb); 266 dev_kfree_skb_irq(skb);
267 else 267 else
@@ -305,7 +305,7 @@ static void ldisc_tx_wakeup(struct tty_struct *tty)
305 305
306 ser = tty->disc_data; 306 ser = tty->disc_data;
307 BUG_ON(ser == NULL); 307 BUG_ON(ser == NULL);
308 BUG_ON(ser->tty != tty); 308 WARN_ON(ser->tty != tty);
309 handle_tx(ser); 309 handle_tx(ser);
310} 310}
311 311
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)
337 /* Get a suitable CAIF packet and copy in data. */ 337 /* Get a suitable CAIF packet and copy in data. */
338 skb = netdev_alloc_skb(pshm_drv->pshm_dev->pshm_netdev, 338 skb = netdev_alloc_skb(pshm_drv->pshm_dev->pshm_netdev,
339 frm_pck_len + 1); 339 frm_pck_len + 1);
340 BUG_ON(skb == NULL); 340
341 if (skb == NULL) {
342 pr_info("OOM: Try next frame in descriptor\n");
343 break;
344 }
341 345
342 p = skb_put(skb, frm_pck_len); 346 p = skb_put(skb, frm_pck_len);
343 memcpy(p, pbuf->desc_vptr + frm_pck_ofs, frm_pck_len); 347 memcpy(p, pbuf->desc_vptr + frm_pck_ofs, frm_pck_len);