Skip to contentSkip to conversation

arm/crc-t10dif: fix use of out-of-scope array in crc_t10dif_arch()

PATCH Applied Eric Biggers 1 participant 2 messages Mar 26, 2025 – Mar 27, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm/crc-t10dif: fix use of out-of-scope array in crc_t10dif_arch()

From: Eric Biggers <[email protected]>

Fix a silly bug where an array was used outside of its scope.

---
 arch/arm/lib/crc-t10dif-glue.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/arm/lib/crc-t10dif-glue.c +1 -3
index f3584ba70e57b..6efad3d78284e 100644
@@ -42,13 +42,11 @@ u16 crc_t10dif_arch(u16 crc, const u8 *data, size_t length)
 
 			kernel_neon_begin();
 			crc_t10dif_pmull8(crc, data, length, buf);
 			kernel_neon_end();
 
-			crc = 0;
-			data = buf;
-			length = sizeof(buf);
+			return crc_t10dif_generic(0, buf, sizeof(buf));
 		}
 	}
 	return crc_t10dif_generic(crc, data, length);
 }
 EXPORT_SYMBOL(crc_t10dif_arch);

base-commit: 1e26c5e28ca5821a824e90dd359556f5e9e7b89f

Signature · 1 line
2.49.0
author Applied
#1 lore raw
Quoted 4 lines · Eric Biggers

From: Eric Biggers <[email protected]>

Fix a silly bug where an array was used outside of its scope.

Quoted 8 lines
---
 arch/arm/lib/crc-t10dif-glue.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Applied to https://web.git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=crc-next

- Eric