From: Pavel Emelyanov Date: Wed, 6 Oct 2010 09:45:56 +0000 (+0400) Subject: sunrpc: Don't return NULL from rpcb_create X-Git-Tag: v3.0~3018^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c636b572e00e38855dc7a56a0fa438dd835f39de;p=platform%2Fkernel%2Flinux-amlogic.git sunrpc: Don't return NULL from rpcb_create > The reason for this is in the future, we may want to support additional > address family types. We should, therefore, ensure that every piece of > code that is sensitive to address families fail in some orderly manner > to let developers know where a change is needed. Makes sense. I was under impression, that AF-s other than INET are not cared about at all :( Here's a fixed version of the patch. Log: Its callers check for ERR_PTR. Signed-off-by: Pavel Emelyanov Reviewed-by: Chuck Lever Signed-off-by: J. Bruce Fields --- diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index 83af38d..1ef2d41 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c @@ -249,7 +249,7 @@ static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr, ((struct sockaddr_in6 *)srvaddr)->sin6_port = htons(RPCBIND_PORT); break; default: - return NULL; + return ERR_PTR(-EAFNOSUPPORT); } return rpc_create(&args);