nfsd: fix error value on allocation failure in nfsd4_decode_test_stateid()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 13 Apr 2012 04:15:37 +0000 (00:15 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 13 Apr 2012 14:12:01 +0000 (10:12 -0400)
PTR_ERR(NULL) is going to be 0...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/nfsd/nfs4xdr.c

index 07a99b6d4bbe2c95597f35adc0654644132449fe..74c00bc92b9af6b01e95e55c119b90d61fbf9d34 100644 (file)
@@ -1392,7 +1392,7 @@ nfsd4_decode_test_stateid(struct nfsd4_compoundargs *argp, struct nfsd4_test_sta
        for (i = 0; i < test_stateid->ts_num_ids; i++) {
                stateid = kmalloc(sizeof(struct nfsd4_test_stateid_id), GFP_KERNEL);
                if (!stateid) {
-                       status = PTR_ERR(stateid);
+                       status = nfserrno(-ENOMEM);
                        goto out;
                }