9p: Check for error in return value of v9fs_fid_add
authorAbhishek Kulkarni <adkulkar@umail.iu.edu>
Sun, 19 Jul 2009 19:41:57 +0000 (13:41 -0600)
committerEric Van Hensbergen <ericvh@strongmad.austin.ibm.com>
Mon, 17 Aug 2009 21:27:57 +0000 (16:27 -0500)
Check if v9fs_fid_add was successful or not based on its
return value.

Signed-off-by: Abhishek Kulkarni <adkulkar@umail.iu.edu>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
fs/9p/vfs_inode.c

index 81f8bbf12f9fe6867112e7e230a3862e46539455..1fa5f15eaddc5d6beec4b771fc74a8ff8ba6e3c5 100644 (file)
@@ -470,7 +470,10 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
                dentry->d_op = &v9fs_dentry_operations;
 
        d_instantiate(dentry, inode);
-       v9fs_fid_add(dentry, fid);
+       err = v9fs_fid_add(dentry, fid);
+       if (err < 0)
+               goto error;
+
        return ofid;
 
 error: