Received: by 10.213.65.68 with SMTP id h4csp3085980imn; Mon, 9 Apr 2018 14:10:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx485gK+gHhzS9BuNW/+641Ozec+pRkZ0y4ljpf5fh/CELTsfvn4DHPT+uCF6J16Lo0CrkThX X-Received: by 10.99.95.22 with SMTP id t22mr26821021pgb.315.1523308206442; Mon, 09 Apr 2018 14:10:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523308206; cv=none; d=google.com; s=arc-20160816; b=sjHwZdpAiicFrZp7asI6WUL9jltC26ib7JH/RBSovHP282ilXTZnF4HHPCz0d9QLtf GZAej2puhQNPZIGu0ERNcoZdd4cWkU6vvUDHTUIlwL5qF/r0dBmHXvpSYNKJYcXbS6Yu aPsisGCfkiibFUsENEgnzo5a/4J5wXq1Nc5B27iBHrikxCoJeVlAa+/BunO4XDuRyVGR CFLcVGNJhJZyhiOPYEw4KWLzOPxzLLcou8p+rOPn4mb3T4d5AVxuINhgo7PTF22h+TPA 7/SRKLyCu5TElkkYx4/s1uL3b9JRVIfdLdVVmxVGaMK95zuYJrmMCuQOoh1Cz0KyUMtm RJBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=oOrV9n4ebDhS1W/G4uF4IMdlLq4fzkwhLWhjwpOaIG8=; b=rstyHXdEjDIJ4gBChqMz7RycqvbNYPFg41aXLneLz5UQEXjDLQMMD6SkHdYlUAIqCA NvW2U6RFQtawlVz/8QNpHMlhnRMicaCMHF3fMmCTc8o16v4eHUFS+bxnh2VSitfCA3WU WE62kP9fPuI7mR3Q9tj76qi+/vVsgTZ15gCm2AQ4c51Yy3at+jDKZvttQym5Rn7yoTlE Gcepo5gmkOXPaGC3bTsSRW2kcOycNm9jaDvTw2PujpO1/5z7Ht/lYGbTid4D6KYDkI7E CyC57GGBpjxKFDlLVv+t1f+zV/Ct+oELm+SgCkbgBNntU/rFza7RXTisPF/herspC7fz asCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a21si815484pfn.281.2018.04.09.14.09.29; Mon, 09 Apr 2018 14:10:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754462AbeDIVGQ (ORCPT + 99 others); Mon, 9 Apr 2018 17:06:16 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33365 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754366AbeDIVGM (ORCPT ); Mon, 9 Apr 2018 17:06:12 -0400 Received: by mail-pf0-f196.google.com with SMTP id f15so6443425pfn.0 for ; Mon, 09 Apr 2018 14:06:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=oOrV9n4ebDhS1W/G4uF4IMdlLq4fzkwhLWhjwpOaIG8=; b=Bn3gmb1LDCkUNgM69v8HGCfoayFr8T2aTakCriZZ8g7SofJBPpUc7ZqU66MoQg5C0A +6QWaWpbq1buA5Y4Wk+ZElSet1j7rFshp3N05HMJ3eADzBPuEw3HvBbkfMe7Wby21nnn OtXVRoobiHcymyvH+7oK8GpNFzB2Vgy+MtQmpRqQKvyjHyYCvXVRHaLFDi5UkfQ4QP8n mxtIwgw+B8g+f1oJ4y4GQbDj9Ip2xd4CVNQm6UFhwTBcMalFSsWFw0/l5+n7VnnC4B++ 9jIa/JwxpK1zxNsMs3VCxYwWk7aTUNuCOC7HJMkJ/uUheMPextDBtheJHn4NcBiIITGn sMGw== X-Gm-Message-State: ALQs6tCzq9dI1H4a9zoabq9YOaVURVnA7jRpiXegFos+nczl2me/GT+Z g8v7LWIMuT1nzS2HFjecZiH3yg== X-Received: by 10.98.19.132 with SMTP id 4mr394097pft.87.1523307972129; Mon, 09 Apr 2018 14:06:12 -0700 (PDT) Received: from labbott-redhat.redhat.com ([2601:602:9802:a8dc::1082]) by smtp.gmail.com with ESMTPSA id h62sm2814737pgc.61.2018.04.09.14.06.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Apr 2018 14:06:11 -0700 (PDT) From: Laura Abbott To: Vinod Koul , Dan Williams Cc: Laura Abbott , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, Kees Cook Subject: [PATCH] dmaengine: dmatest: Remove use of VLAs Date: Mon, 9 Apr 2018 14:06:03 -0700 Message-Id: <20180409210603.3575-1-labbott@redhat.com> X-Mailer: git-send-email 2.14.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There's an ongoing effort to remove VLAs from the kernel (https://lkml.org/lkml/2018/3/7/621) to eventually turn on -Wvla. The uses in dmatest are bounded by a check to make sure they fit in a u8 so use that as an upper bound. Signed-off-by: Laura Abbott --- drivers/dma/dmatest.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index 80cc2be6483c..dcf787b173e4 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c @@ -556,7 +556,8 @@ static int dmatest_func(void *data) && !(params->iterations && total_tests >= params->iterations)) { struct dma_async_tx_descriptor *tx = NULL; struct dmaengine_unmap_data *um; - dma_addr_t srcs[src_cnt]; + /* total buffer count must fit into u8 */ + dma_addr_t srcs[255]; dma_addr_t *dsts; unsigned int src_off, dst_off, len; @@ -669,7 +670,8 @@ static int dmatest_func(void *data) srcs, src_cnt, len, flags); else if (thread->type == DMA_PQ) { - dma_addr_t dma_pq[dst_cnt]; + /* dst_cnt can't be more than u8 */ + dma_addr_t dma_pq[255]; for (i = 0; i < dst_cnt; i++) dma_pq[i] = dsts[i] + dst_off; -- 2.14.3