[2.6 patch] net/sunrpc/clnt.c: fix a NULL pointer dereference

From: Adrian Bunk
Date: Fri Mar 10 2006 - 18:01:36 EST


The Coverity checker spotted this possible NULL pointer dereference in
rpc_new_client().


Signed-off-by: Adrian Bunk <bunk@xxxxxxxxx>

--- linux-2.6.16-rc5-mm3-full/net/sunrpc/clnt.c.old 2006-03-10 23:39:20.000000000 +0100
+++ linux-2.6.16-rc5-mm3-full/net/sunrpc/clnt.c 2006-03-10 23:40:03.000000000 +0100
@@ -112,7 +112,7 @@ rpc_new_client(struct rpc_xprt *xprt, ch

err = -EINVAL;
if (!xprt)
- goto out_err;
+ goto out_no_xprt;
if (vers >= program->nrvers || !(version = program->version[vers]))
goto out_err;

@@ -182,6 +182,7 @@ out_no_path:
kfree(clnt);
out_err:
xprt_destroy(xprt);
+out_no_xprt:
return ERR_PTR(err);
}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/