Skip to content

Commit

Permalink
SUNRPC: remove BUG_ON in svc_register
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Weston Andros Adamson authored and Trond Myklebust committed Nov 4, 2012
1 parent 332e008 commit 0af3950
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/sunrpc/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 0af3950

Please sign in to comment.