hfs: incorrect return values
authorChengyu Song <csong84@gatech.edu>
Thu, 16 Apr 2015 19:46:53 +0000 (12:46 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 17 Apr 2015 13:04:04 +0000 (09:04 -0400)
In case of memory allocation error, the return should be -ENOMEM, instead
of -ENOSPC.

Signed-off-by: Chengyu Song <csong84@gatech.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/hfs/dir.c

index 145566851e7a821fd1d87bbb9c111ce839ecf7db..36d1a6ae765590cf0d442d5c688d201b0e781525 100644 (file)
@@ -197,7 +197,7 @@ static int hfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
 
        inode = hfs_new_inode(dir, &dentry->d_name, mode);
        if (!inode)
-               return -ENOSPC;
+               return -ENOMEM;
 
        res = hfs_cat_create(inode->i_ino, dir, &dentry->d_name, inode);
        if (res) {
@@ -226,7 +226,7 @@ static int hfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
 
        inode = hfs_new_inode(dir, &dentry->d_name, S_IFDIR | mode);
        if (!inode)
-               return -ENOSPC;
+               return -ENOMEM;
 
        res = hfs_cat_create(inode->i_ino, dir, &dentry->d_name, inode);
        if (res) {