Re: [PATCH 21/25] SUNRPC: remove BUG_ON() in svc_register()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2012-10-16 at 12:30 -0400, Weston Andros Adamson wrote:
> Instead of calling BUG_ON() return -EINVAL.
> 
> Signed-off-by: Weston Andros Adamson <dros@xxxxxxxxxx>
> ---
>  net/sunrpc/svc.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
> index 3bf5a54..b5ac8b3 100644
> --- a/net/sunrpc/svc.c
> +++ b/net/sunrpc/svc.c
> @@ -950,7 +950,8 @@ int svc_register(const struct svc_serv *serv, struct net *net,
>  	unsigned int		i;
>  	int			error = 0;
>  
> -	BUG_ON(proto == 0 && port == 0);
> +	if (proto == 0 && port == 0)
> +		return -EINVAL;

Again, this is a condition that the user needs to report to us, so a
WARN_ON_ONCE() would be useful.

>  	for (progp = serv->sv_program; progp; progp = progp->pg_next) {
>  		for (i = 0; i < progp->pg_nvers; i++) {

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@xxxxxxxxxx
www.netapp.com
��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux