From ee930fffee469d076998274a2ca55e13dc1efb67 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Fri, 10 May 2024 08:50:54 +0000
Subject: [PATCH] enable tun/tap/iptables

---
 kernel/drivers/crypto/rockchip/rk_crypto_utils.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/drivers/crypto/rockchip/rk_crypto_utils.c b/kernel/drivers/crypto/rockchip/rk_crypto_utils.c
index 5db73ab..5758e0e 100644
--- a/kernel/drivers/crypto/rockchip/rk_crypto_utils.c
+++ b/kernel/drivers/crypto/rockchip/rk_crypto_utils.c
@@ -72,14 +72,18 @@
 {
 	int in, out, align;
 
+	/* The last piece has no need for length alignment */
 	in = IS_ALIGNED((u32)sg_src->offset, 4) &&
-	     IS_ALIGNED((u32)sg_src->length, align_mask) &&
+	     (!sg_next(sg_src) ||
+	      IS_ALIGNED((u32)sg_src->length, align_mask)) &&
 	     (sg_phys(sg_src) < SZ_4G);
 	if (!sg_dst)
 		return in;
 
+	/* The last piece has no need for length alignment */
 	out = IS_ALIGNED((u32)sg_dst->offset, 4) &&
-	      IS_ALIGNED((u32)sg_dst->length, align_mask) &&
+	      (!sg_next(sg_dst) ||
+	       IS_ALIGNED((u32)sg_dst->length, align_mask)) &&
 	      (sg_phys(sg_dst) < SZ_4G);
 	align = in && out;
 

--
Gitblit v1.6.2