diff options
author | Kukjin Kim <kgene.kim@samsung.com> | 2013-04-08 18:10:13 +0200 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2013-04-08 18:10:13 +0200 |
commit | da821eb7d42935b0f7056d98c75fd1150f6636f4 (patch) | |
tree | de83ac171d51bbe7621110c3145a68c198b13711 /ipc/msg.c | |
parent | ARM: EXYNOS: fix compilation error introduced due to common clock migration (diff) | |
parent | Linux 3.9-rc5 (diff) | |
download | linux-da821eb7d42935b0f7056d98c75fd1150f6636f4.tar.xz linux-da821eb7d42935b0f7056d98c75fd1150f6636f4.zip |
Merge commit 'v3.9-rc5' into next/clk-exynos
Conflicts:
arch/arm/boot/dts/exynos4.dtsi
arch/arm/boot/dts/exynos5440.dtsi
Diffstat (limited to 'ipc/msg.c')
-rw-r--r-- | ipc/msg.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ipc/msg.c b/ipc/msg.c index 950572f9d796..31cd1bf6af27 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -820,15 +820,17 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, struct msg_msg *copy = NULL; unsigned long copy_number = 0; + ns = current->nsproxy->ipc_ns; + if (msqid < 0 || (long) bufsz < 0) return -EINVAL; if (msgflg & MSG_COPY) { - copy = prepare_copy(buf, bufsz, msgflg, &msgtyp, ©_number); + copy = prepare_copy(buf, min_t(size_t, bufsz, ns->msg_ctlmax), + msgflg, &msgtyp, ©_number); if (IS_ERR(copy)) return PTR_ERR(copy); } mode = convert_mode(&msgtyp, msgflg); - ns = current->nsproxy->ipc_ns; msq = msg_lock_check(ns, msqid); if (IS_ERR(msq)) { |