aboutsummaryrefslogtreecommitdiffstats
path: root/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 /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 'net/caif')
-rw-r--r--net/caif/caif_dev.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c
index 9b298c14028d..b0ce14fbf6ef 100644
--- a/net/caif/caif_dev.c
+++ b/net/caif/caif_dev.c
@@ -58,7 +58,6 @@ static int q_high = 50; /* Percent */
58struct cfcnfg *get_cfcnfg(struct net *net) 58struct cfcnfg *get_cfcnfg(struct net *net)
59{ 59{
60 struct caif_net *caifn; 60 struct caif_net *caifn;
61 BUG_ON(!net);
62 caifn = net_generic(net, caif_net_id); 61 caifn = net_generic(net, caif_net_id);
63 if (!caifn) 62 if (!caifn)
64 return NULL; 63 return NULL;
@@ -69,7 +68,6 @@ EXPORT_SYMBOL(get_cfcnfg);
69static struct caif_device_entry_list *caif_device_list(struct net *net) 68static struct caif_device_entry_list *caif_device_list(struct net *net)
70{ 69{
71 struct caif_net *caifn; 70 struct caif_net *caifn;
72 BUG_ON(!net);
73 caifn = net_generic(net, caif_net_id); 71 caifn = net_generic(net, caif_net_id);
74 if (!caifn) 72 if (!caifn)
75 return NULL; 73 return NULL;
@@ -507,15 +505,15 @@ static struct notifier_block caif_device_notifier = {
507static int caif_init_net(struct net *net) 505static int caif_init_net(struct net *net)
508{ 506{
509 struct caif_net *caifn = net_generic(net, caif_net_id); 507 struct caif_net *caifn = net_generic(net, caif_net_id);
510 BUG_ON(!caifn); 508 if (WARN_ON(!caifn))
509 return -EINVAL;
510
511 INIT_LIST_HEAD(&caifn->caifdevs.list); 511 INIT_LIST_HEAD(&caifn->caifdevs.list);
512 mutex_init(&caifn->caifdevs.lock); 512 mutex_init(&caifn->caifdevs.lock);
513 513
514 caifn->cfg = cfcnfg_create(); 514 caifn->cfg = cfcnfg_create();
515 if (!caifn->cfg) { 515 if (!caifn->cfg)
516 pr_warn("can't create cfcnfg\n");
517 return -ENOMEM; 516 return -ENOMEM;
518 }
519 517
520 return 0; 518 return 0;
521} 519}