ethtool: add speed/duplex validation functions
[cascardo/linux.git] / crypto / algif_skcipher.c
index df86fb4..38c1aa8 100644 (file)
@@ -243,7 +243,7 @@ static void skcipher_wmem_wakeup(struct sock *sk)
 
        rcu_read_lock();
        wq = rcu_dereference(sk->sk_wq);
-       if (wq_has_sleeper(wq))
+       if (skwq_has_sleeper(wq))
                wake_up_interruptible_sync_poll(&wq->wait, POLLIN |
                                                           POLLRDNORM |
                                                           POLLRDBAND);
@@ -293,7 +293,7 @@ static void skcipher_data_wakeup(struct sock *sk)
 
        rcu_read_lock();
        wq = rcu_dereference(sk->sk_wq);
-       if (wq_has_sleeper(wq))
+       if (skwq_has_sleeper(wq))
                wake_up_interruptible_sync_poll(&wq->wait, POLLOUT |
                                                           POLLRDNORM |
                                                           POLLRDBAND);
@@ -392,7 +392,8 @@ static int skcipher_sendmsg(struct socket *sock, struct msghdr *msg,
 
                sgl = list_entry(ctx->tsgl.prev, struct skcipher_sg_list, list);
                sg = sgl->sg;
-               sg_unmark_end(sg + sgl->cur);
+               if (sgl->cur)
+                       sg_unmark_end(sg + sgl->cur - 1);
                do {
                        i = sgl->cur;
                        plen = min_t(size_t, len, PAGE_SIZE);