Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185735
b: refs/heads/master
c: 8834cf7
h: refs/heads/master
i:
  185733: 7f7746c
  185731: d95531b
  185727: 3a939f9
v: v3
  • Loading branch information
André Goddard Rosa authored and Al Viro committed Mar 3, 2010
1 parent 79c5300 commit b39ed1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 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: c8308b1c91056b09e96d40dbde4880ea685c377e
refs/heads/master: 8834cf796a4320be2d3a70b1e4f9aba732a0f4ee
9 changes: 5 additions & 4 deletions trunk/ipc/mqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,9 @@ static void mqueue_delete_inode(struct inode *inode)

clear_inode(inode);

mq_bytes = (info->attr.mq_maxmsg * sizeof(struct msg_msg *) +
(info->attr.mq_maxmsg * info->attr.mq_msgsize));
/* Total amount of bytes accounted for the mqueue */
mq_bytes = info->attr.mq_maxmsg * (sizeof(struct msg_msg *)
+ info->attr.mq_msgsize);
user = info->user;
if (user) {
spin_lock(&mq_lock);
Expand Down Expand Up @@ -601,8 +602,8 @@ static int mq_attr_ok(struct ipc_namespace *ipc_ns, struct mq_attr *attr)
/* check for overflow */
if (attr->mq_msgsize > ULONG_MAX/attr->mq_maxmsg)
return 0;
if ((unsigned long)(attr->mq_maxmsg * attr->mq_msgsize) +
(attr->mq_maxmsg * sizeof (struct msg_msg *)) <
if ((unsigned long)(attr->mq_maxmsg * (attr->mq_msgsize
+ sizeof (struct msg_msg *))) <
(unsigned long)(attr->mq_maxmsg * attr->mq_msgsize))
return 0;
return 1;
Expand Down

0 comments on commit b39ed1e

Please sign in to comment.