SUNRPC: svc_tcp_sendmsg() should handle errors from xdr_alloc_bvec()
[sfrench/cifs-2.6.git] / net / sunrpc / svcsock.c
index 478f857cdaed4548e7c181b3a6cc41ecf5a1425b..6ea3d87e11475ec46b36efbdd6675460f58876be 100644 (file)
@@ -1096,7 +1096,9 @@ static int svc_tcp_sendmsg(struct socket *sock, struct xdr_buf *xdr,
        int ret;
 
        *sentp = 0;
-       xdr_alloc_bvec(xdr, GFP_KERNEL);
+       ret = xdr_alloc_bvec(xdr, GFP_KERNEL);
+       if (ret < 0)
+               return ret;
 
        ret = kernel_sendmsg(sock, &msg, &rm, 1, rm.iov_len);
        if (ret < 0)