summaryrefslogtreecommitdiffstats
path: root/crypto/async_tx/raid6test.c
diff options
context:
space:
mode:
authorKyle Spiers2018-06-01 22:20:16 +0200
committerVinod Koul2018-06-18 16:47:38 +0200
commit89a7e2f752859c1a1696adf7b00b6ca9a5da2cda (patch)
tree20efdb47f75740523ed334e1f3e816c7b07dc039 /crypto/async_tx/raid6test.c
parentLinux 4.18-rc1 (diff)
downloadkernel-qcow2-linux-89a7e2f752859c1a1696adf7b00b6ca9a5da2cda.tar.gz
kernel-qcow2-linux-89a7e2f752859c1a1696adf7b00b6ca9a5da2cda.tar.xz
kernel-qcow2-linux-89a7e2f752859c1a1696adf7b00b6ca9a5da2cda.zip
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 <ksspiers@google.com> Reviewed-by: Kees Cook <keescook@chromium.org> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'crypto/async_tx/raid6test.c')
-rw-r--r--crypto/async_tx/raid6test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/async_tx/raid6test.c b/crypto/async_tx/raid6test.c
index dad95f45b88f..a5edaabae12a 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
*/