From b7b70223732189f017cfac01474115ef9f0139e9 Mon Sep 17 00:00:00 2001 From: Kyle Spiers Date: Fri, 1 Jun 2018 13:20:16 -0700 Subject: async_pq: Remove VLA usage In the quest to remove VLAs from the kernel[1], this adjusts the allocation of coefs and blocks to use the existing maximum values (with one new define, MAX_DISKS for coefs, and a reuse of the existing NDISKS for blocks). [1] https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Kyle Spiers Reviewed-by: Kees Cook Reviewed-by: Dan Williams Signed-off-by: Vinod Koul --- crypto/async_tx/raid6test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crypto/async_tx/raid6test.c') diff --git a/crypto/async_tx/raid6test.c b/crypto/async_tx/raid6test.c index dad95f45..a5edaaba 100644 --- a/crypto/async_tx/raid6test.c +++ b/crypto/async_tx/raid6test.c @@ -81,11 +81,13 @@ static void raid6_dual_recov(int disks, size_t bytes, int faila, int failb, stru init_async_submit(&submit, 0, NULL, NULL, NULL, addr_conv); tx = async_gen_syndrome(ptrs, 0, disks, bytes, &submit); } else { - struct page *blocks[disks]; + struct page *blocks[NDISKS]; struct page *dest; int count = 0; int i; + BUG_ON(disks > NDISKS); + /* data+Q failure. Reconstruct data from P, * then rebuild syndrome */ -- cgit v1.2.3