aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ipc/mqueue.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index f8eba5e46c5a..6828e2c93cef 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -153,7 +153,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb,
153 info->attr.mq_msgsize = attr->mq_msgsize; 153 info->attr.mq_msgsize = attr->mq_msgsize;
154 } 154 }
155 mq_msg_tblsz = info->attr.mq_maxmsg * sizeof(struct msg_msg *); 155 mq_msg_tblsz = info->attr.mq_maxmsg * sizeof(struct msg_msg *);
156 if (mq_msg_tblsz > KMALLOC_MAX_SIZE) 156 if (mq_msg_tblsz > PAGE_SIZE)
157 info->messages = vmalloc(mq_msg_tblsz); 157 info->messages = vmalloc(mq_msg_tblsz);
158 else 158 else
159 info->messages = kmalloc(mq_msg_tblsz, GFP_KERNEL); 159 info->messages = kmalloc(mq_msg_tblsz, GFP_KERNEL);
@@ -266,7 +266,7 @@ static void mqueue_evict_inode(struct inode *inode)
266 spin_lock(&info->lock); 266 spin_lock(&info->lock);
267 for (i = 0; i < info->attr.mq_curmsgs; i++) 267 for (i = 0; i < info->attr.mq_curmsgs; i++)
268 free_msg(info->messages[i]); 268 free_msg(info->messages[i]);
269 if (info->attr.mq_maxmsg * sizeof(struct msg_msg *) > KMALLOC_MAX_SIZE) 269 if (is_vmalloc_addr(info->messages))
270 vfree(info->messages); 270 vfree(info->messages);
271 else 271 else
272 kfree(info->messages); 272 kfree(info->messages);