net: Fix soft lockups/OOM issues w/ unix garbage collector
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / unix / af_unix.c
index eb90f77bb0e294b6358db3361740deaa0bec969e..66d5ac4773abac12f517c84b25916dc078cda007 100644 (file)
@@ -1343,6 +1343,7 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
 
        if (NULL == siocb->scm)
                siocb->scm = &tmp_scm;
+       wait_for_unix_gc();
        err = scm_send(sock, msg, siocb->scm);
        if (err < 0)
                return err;
@@ -1493,6 +1494,7 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
 
        if (NULL == siocb->scm)
                siocb->scm = &tmp_scm;
+       wait_for_unix_gc();
        err = scm_send(sock, msg, siocb->scm);
        if (err < 0)
                return err;