]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/sunrpc/cache.c
Merge remote-tracking branch 'remotes/stable/linux-4.4.y' into karo-tx6-mainline
[karo-tx-linux.git] / net / sunrpc / cache.c
index 5e4f815c2b34d22fba11ac2443e9d66bc27c779c..63fb5ee212cf8d168a53ce819d3e3f42a7e53fba 100644 (file)
@@ -1182,14 +1182,14 @@ int sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h)
        }
 
        crq->q.reader = 0;
-       crq->item = cache_get(h);
        crq->buf = buf;
        crq->len = 0;
        crq->readers = 0;
        spin_lock(&queue_lock);
-       if (test_bit(CACHE_PENDING, &h->flags))
+       if (test_bit(CACHE_PENDING, &h->flags)) {
+               crq->item = cache_get(h);
                list_add_tail(&crq->q.list, &detail->queue);
-       else
+       else
                /* Lost a race, no longer PENDING, so don't enqueue */
                ret = -EAGAIN;
        spin_unlock(&queue_lock);
@@ -1225,7 +1225,7 @@ int qword_get(char **bpp, char *dest, int bufsize)
        if (bp[0] == '\\' && bp[1] == 'x') {
                /* HEX STRING */
                bp += 2;
-               while (len < bufsize) {
+               while (len < bufsize - 1) {
                        int h, l;
 
                        h = hex_to_bin(bp[0]);