summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWeston Andros Adamson <dros@netapp.com>2012-10-23 10:43:45 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-11-04 14:43:42 -0500
commit0af39507f60ee9f98b20f24af09c1a60655417ac (patch)
tree91e8719217c75f71670e2d6f199d0d4c127349e4
parent332e008a44d1ab6ca85b2214578f2f89af04a2fc (diff)
downloadtalos-op-linux-0af39507f60ee9f98b20f24af09c1a60655417ac.tar.gz
talos-op-linux-0af39507f60ee9f98b20f24af09c1a60655417ac.zip
SUNRPC: remove BUG_ON in svc_register
Instead of calling BUG_ON(), do a WARN_ON_ONCE() and return -EINVAL. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--net/sunrpc/svc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 3bf5a54982ba..dfa4ba69ff45 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -950,7 +950,9 @@ int svc_register(const struct svc_serv *serv, struct net *net,
unsigned int i;
int error = 0;
- BUG_ON(proto == 0 && port == 0);
+ WARN_ON_ONCE(proto == 0 && port == 0);
+ if (proto == 0 && port == 0)
+ return -EINVAL;
for (progp = serv->sv_program; progp; progp = progp->pg_next) {
for (i = 0; i < progp->pg_nvers; i++) {
OpenPOWER on IntegriCloud