summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorRoar Førde <roar.forde@stericsson.com>2011-12-06 13:15:44 +0100
committerDavid S. Miller <davem@davemloft.net>2011-12-06 23:21:47 +0100
commitf84ea779c25dabc90956f1c329e5e5c501ea96cc (patch)
tree8a66cb38fb4f7d04bf5a1c3405c73802eaac0614 /net
parentcaif-shm: Bugfixes for caif_shmcore.c (diff)
downloadlinux-f84ea779c25dabc90956f1c329e5e5c501ea96cc.tar.xz
linux-f84ea779c25dabc90956f1c329e5e5c501ea96cc.zip
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')
-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 */
struct cfcnfg *get_cfcnfg(struct net *net)
{
struct caif_net *caifn;
- BUG_ON(!net);
caifn = net_generic(net, caif_net_id);
if (!caifn)
return NULL;
@@ -69,7 +68,6 @@ EXPORT_SYMBOL(get_cfcnfg);
static struct caif_device_entry_list *caif_device_list(struct net *net)
{
struct caif_net *caifn;
- BUG_ON(!net);
caifn = net_generic(net, caif_net_id);
if (!caifn)
return NULL;
@@ -507,15 +505,15 @@ static struct notifier_block caif_device_notifier = {
static int caif_init_net(struct net *net)
{
struct caif_net *caifn = net_generic(net, caif_net_id);
- BUG_ON(!caifn);
+ if (WARN_ON(!caifn))
+ return -EINVAL;
+
INIT_LIST_HEAD(&caifn->caifdevs.list);
mutex_init(&caifn->caifdevs.lock);
caifn->cfg = cfcnfg_create();
- if (!caifn->cfg) {
- pr_warn("can't create cfcnfg\n");
+ if (!caifn->cfg)
return -ENOMEM;
- }
return 0;
}