From: Weston Andros Adamson Date: Tue, 23 Oct 2012 14:43:45 +0000 (-0400) Subject: SUNRPC: remove BUG_ON in svc_register X-Git-Tag: v3.8-rc1~72^2~68 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0af39507f60ee9f98b20f24af09c1a60655417ac;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 Signed-off-by: Trond Myklebust --- diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 3bf5a54..dfa4ba6 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++) {