Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260424
b: refs/heads/master
c: d40dcdb
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed Jul 26, 2011
1 parent 1007b21 commit fef0042
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 04715206c0c2fd4ec5ca77fa51e3a5b41ce71492
refs/heads/master: d40dcdb0172a1ba853464983a059fb45e0aaf61a
12 changes: 7 additions & 5 deletions trunk/ipc/mqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb,
{
struct user_struct *u = current_user();
struct inode *inode;
int ret = -ENOMEM;

inode = new_inode(sb);
if (!inode)
Expand Down Expand Up @@ -160,6 +161,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb,
u->mq_bytes + mq_bytes > task_rlimit(p, RLIMIT_MSGQUEUE)) {
spin_unlock(&mq_lock);
/* mqueue_evict_inode() releases info->messages */
ret = -EMFILE;
goto out_inode;
}
u->mq_bytes += mq_bytes;
Expand All @@ -179,7 +181,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb,
out_inode:
iput(inode);
err:
return NULL;
return ERR_PTR(ret);
}

static int mqueue_fill_super(struct super_block *sb, void *data, int silent)
Expand All @@ -195,8 +197,8 @@ static int mqueue_fill_super(struct super_block *sb, void *data, int silent)

inode = mqueue_get_inode(sb, ns, S_IFDIR | S_ISVTX | S_IRWXUGO,
NULL);
if (!inode) {
error = -ENOMEM;
if (IS_ERR(inode)) {
error = PTR_ERR(inode);
goto out;
}

Expand Down Expand Up @@ -316,8 +318,8 @@ static int mqueue_create(struct inode *dir, struct dentry *dentry,
spin_unlock(&mq_lock);

inode = mqueue_get_inode(dir->i_sb, ipc_ns, mode, attr);
if (!inode) {
error = -ENOMEM;
if (IS_ERR(inode)) {
error = PTR_ERR(inode);
spin_lock(&mq_lock);
ipc_ns->mq_queues_count--;
goto out_unlock;
Expand Down

0 comments on commit fef0042

Please sign in to comment.