diff options
author | Arnd Bergmann <arnd@arndb.de> | 2013-03-14 18:55:59 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2013-03-14 18:55:59 -0400 |
commit | 7ac6c89189c669fd5f883937f291f18d324d470b (patch) | |
tree | 5f0712bdedac45a40148ede0064d4e6eddb4260e /ipc/msg.c | |
parent | 6fdd496e07f511a94ba27e4a1433038b32d6af05 (diff) | |
parent | 0ed66befaae893e82c9f016238282d73ef9fd6c7 (diff) |
Merge tag 'at91-fixes' of git://github.com/at91linux/linux-at91 into fixes
From Nicolas Ferre <nicolas.ferre@atmel.com>:
Two patches for Device Tree on at91sam9x5/NAND.
Two more for fixing PM suspend/resume IRQ on AIC5 and
GPIO used with pinctrl.
* tag 'at91-fixes' of git://github.com/at91linux/linux-at91:
ARM: at91: fix infinite loop in at91_irq_suspend/resume
ARM: at91: add gpio suspend/resume support when using pinctrl
ARM: at91: dt: at91sam9x5: complete NAND pinctrl
ARM: at91: dt: at91sam9x5: correct NAND pins comments
Includes an update to -rc2
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'ipc/msg.c')
-rw-r--r-- | ipc/msg.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -820,15 +820,17 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, | |||
820 | struct msg_msg *copy = NULL; | 820 | struct msg_msg *copy = NULL; |
821 | unsigned long copy_number = 0; | 821 | unsigned long copy_number = 0; |
822 | 822 | ||
823 | ns = current->nsproxy->ipc_ns; | ||
824 | |||
823 | if (msqid < 0 || (long) bufsz < 0) | 825 | if (msqid < 0 || (long) bufsz < 0) |
824 | return -EINVAL; | 826 | return -EINVAL; |
825 | if (msgflg & MSG_COPY) { | 827 | if (msgflg & MSG_COPY) { |
826 | copy = prepare_copy(buf, bufsz, msgflg, &msgtyp, ©_number); | 828 | copy = prepare_copy(buf, min_t(size_t, bufsz, ns->msg_ctlmax), |
829 | msgflg, &msgtyp, ©_number); | ||
827 | if (IS_ERR(copy)) | 830 | if (IS_ERR(copy)) |
828 | return PTR_ERR(copy); | 831 | return PTR_ERR(copy); |
829 | } | 832 | } |
830 | mode = convert_mode(&msgtyp, msgflg); | 833 | mode = convert_mode(&msgtyp, msgflg); |
831 | ns = current->nsproxy->ipc_ns; | ||
832 | 834 | ||
833 | msq = msg_lock_check(ns, msqid); | 835 | msq = msg_lock_check(ns, msqid); |
834 | if (IS_ERR(msq)) { | 836 | if (IS_ERR(msq)) { |