drm/ttm: handle the SYSTEM->TT path in same place as others.
[linux-2.6-microblaze.git] / crypto / af_alg.c
index a6f581a..8be8bec 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/module.h>
 #include <linux/net.h>
 #include <linux/rwsem.h>
+#include <linux/sched.h>
 #include <linux/sched/signal.h>
 #include <linux/security.h>
 
@@ -845,9 +846,15 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size,
        }
 
        lock_sock(sk);
-       if (ctx->init && (init || !ctx->more)) {
-               err = -EINVAL;
-               goto unlock;
+       if (ctx->init && !ctx->more) {
+               if (ctx->used) {
+                       err = -EINVAL;
+                       goto unlock;
+               }
+
+               pr_info_once(
+                       "%s sent an empty control message without MSG_MORE.\n",
+                       current->comm);
        }
        ctx->init = true;