]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - crypto/af_alg.c
afs: Fix the handling of CB.InitCallBackState3 to find the server by UUID
[mirror_ubuntu-bionic-kernel.git] / crypto / af_alg.c
index 5231f421ad0006663e14b28cf47b577ad0443c83..ef2064d560a6a78ac89f38ca81234445f0e567fe 100644 (file)
@@ -158,16 +158,16 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
        void *private;
        int err;
 
-       /* If caller uses non-allowed flag, return error. */
-       if ((sa->salg_feat & ~allowed) || (sa->salg_mask & ~allowed))
-               return -EINVAL;
-
        if (sock->state == SS_CONNECTED)
                return -EINVAL;
 
        if (addr_len < sizeof(*sa))
                return -EINVAL;
 
+       /* If caller uses non-allowed flag, return error. */
+       if ((sa->salg_feat & ~allowed) || (sa->salg_mask & ~allowed))
+               return -EINVAL;
+
        sa->salg_type[sizeof(sa->salg_type) - 1] = 0;
        sa->salg_name[sizeof(sa->salg_name) + addr_len - sizeof(*sa) - 1] = 0;