summaryrefslogtreecommitdiff
path: root/crypto/af_alg.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2023-07-18 14:24:49 +0200
committerTakashi Iwai <tiwai@suse.de>2023-07-18 14:24:56 +0200
commit21634f0f307c8401462da2cd07507880ee17d3fc (patch)
tree8dd1b41a5a1bd9fe9a340814c4101f33df827f40 /crypto/af_alg.c
parent6d68d9cba1d0d1ee628a783eb9e7d38a0c3691b8 (diff)
parent2218e10e6fec05f76d6cd2c7eed4cb5af447360b (diff)
Merge branch 'topic/hda-pci-ids' into for-next
Pull cleanup of HD-audio PCI IDs. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'crypto/af_alg.c')
-rw-r--r--crypto/af_alg.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index 6218c773d71c..06b15b9f661c 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -992,7 +992,7 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size,
ssize_t plen;
/* use the existing memory in an allocated page */
- if (ctx->merge) {
+ if (ctx->merge && !(msg->msg_flags & MSG_SPLICE_PAGES)) {
sgl = list_entry(ctx->tsgl_list.prev,
struct af_alg_tsgl, list);
sg = sgl->sg + sgl->cur - 1;
@@ -1054,6 +1054,7 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size,
ctx->used += plen;
copied += plen;
size -= plen;
+ ctx->merge = 0;
} else {
do {
struct page *pg;
@@ -1085,12 +1086,12 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size,
size -= plen;
sgl->cur++;
} while (len && sgl->cur < MAX_SGL_ENTS);
+
+ ctx->merge = plen & (PAGE_SIZE - 1);
}
if (!size)
sg_mark_end(sg + sgl->cur - 1);
-
- ctx->merge = plen & (PAGE_SIZE - 1);
}
err = 0;