Skip to content

Commit

Permalink
hfs: incorrect return values
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ChengyuSong authored and torvalds committed Apr 17, 2015
1 parent faea2c5 commit 13f2448
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/hfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 13f2448

Please sign in to comment.