OSDN Git Service

MIPS: VDSO: Prevent use of smp_processor_id()
[android-x86/kernel.git] / ipc / msg.c
index e12307d..ff10d43 100644 (file)
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -763,7 +763,10 @@ static inline int convert_mode(long *msgtyp, int msgflg)
        if (*msgtyp == 0)
                return SEARCH_ANY;
        if (*msgtyp < 0) {
-               *msgtyp = -*msgtyp;
+               if (*msgtyp == LONG_MIN) /* -LONG_MIN is undefined */
+                       *msgtyp = LONG_MAX;
+               else
+                       *msgtyp = -*msgtyp;
                return SEARCH_LESSEQUAL;
        }
        if (msgflg & MSG_EXCEPT)