Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp45922pxb; Mon, 13 Sep 2021 12:30:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbVZimCBMQa81qza+18Y4S/2/HwR3dGmHq/ANaqbSHYBK5kXoiV0lb/f6ZoHjFRqN98x6p X-Received: by 2002:a05:6402:694:: with SMTP id f20mr6511609edy.100.1631561454501; Mon, 13 Sep 2021 12:30:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631561454; cv=none; d=google.com; s=arc-20160816; b=sdUodD6uhXTfChGCzEfbA0ndtmaLIZd88msKIbznQEw9XLPc4chBm57MgylsG4lkCo svu36aRv7Osvq5u0+gdlGsUdylkw1J8D1cSnXPrVW5lVFLTNQaVsgjB5XhZ7wUdbsN1Y M14THMQMDn3KxHNhCR+9GcsFJqbBigTYFpHitM+SALdJ2RxbpB4XS8iVBeYDX2As+khJ cwe9ZZltPfGWB8GlJ3T5iKj3UcXhsFS5oTRHMP02XshT4hnQuZshN3J9D0P4IUYuJ1US BUFHJDeOb0wZegbHeHnJQElIDyO6Wz4WwUrL8uKxcLa+syqL6rfifXQElL0mNycChExd U61g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=X1NQ7Mo30Q4d/piTi8qQ1Uq6B1V9L582Vjeywm6UiWQ=; b=GcU3d1IwQ71HNHTkC/9a/h8NmsaQ4L59SLDH44SYzQ44fWhr/qF3x93T4sDUaL6JcL iHTlGlG/rmdMvKgff+OTw2xMdu9W/rYiadsKuWa6e/CED4QcMKXainYKg6kWbX1QwGhO rgfV0B015au3v2eLzPFaiIQNBOz4uCg4FO8GOTUp1ZbO4q2hczWiBZaGMsPgp/nj+4j2 Z/BTkSRjI7RRiE9uWLF5Gpjr0AQy6Lxbgm6B2rJsvj6ab/KMZsp6MTs6vqCcNjE3D+xF dAcEUW7DvL0lnoQqxbaQb+DT+Xmfo8zma4p9PyhWhiRQej27tM8jWYlm4lGvK295bmno DPQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QStFa7A4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s28si8167051edw.13.2021.09.13.12.30.31; Mon, 13 Sep 2021 12:30:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QStFa7A4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240586AbhIMNfi (ORCPT + 99 others); Mon, 13 Sep 2021 09:35:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:58362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242065AbhIMNa4 (ORCPT ); Mon, 13 Sep 2021 09:30:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F317B610CF; Mon, 13 Sep 2021 13:25:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539505; bh=zI6ZAt0/5MVMLtxd2ZnC1lYICx39p9MpuBKpK/u7SDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QStFa7A4mHY5dxOcXaGd6jFzJIp/X22Z83Sb4TS8mgOw+F6iXuBjQtlLINB/vkc/I xpMqTtAqnHb5ZBGWFuDGt5PYYNBFRCLNx5vU0dDhC5M8F6nZ5IceYLdCsypZvs2zJP cc5BHU9p6OZrM6rXzfxdzqNOrPfwQqdLihOCK0K0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Purna Chandra Mandal , Peter Ujfalusi , Vinod Koul , Tony Lindgren , Mark Brown , Sasha Levin Subject: [PATCH 5.10 050/236] spi: spi-pic32: Fix issue with uninitialized dma_slave_config Date: Mon, 13 Sep 2021 15:12:35 +0200 Message-Id: <20210913131102.059265865@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tony Lindgren [ Upstream commit 976c1de1de147bb7f4e0d87482f375221c05aeaf ] Depending on the DMA driver being used, the struct dma_slave_config may need to be initialized to zero for the unused data. For example, we have three DMA drivers using src_port_window_size and dst_port_window_size. If these are left uninitialized, it can cause DMA failures. For spi-pic32, this is probably not currently an issue but is still good to fix though. Fixes: 1bcb9f8ceb67 ("spi: spi-pic32: Add PIC32 SPI master driver") Cc: Purna Chandra Mandal Cc: Peter Ujfalusi Cc: Vinod Koul Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20210810081727.19491-2-tony@atomide.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-pic32.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-pic32.c b/drivers/spi/spi-pic32.c index 104bde153efd..5eb7b61bbb4d 100644 --- a/drivers/spi/spi-pic32.c +++ b/drivers/spi/spi-pic32.c @@ -361,6 +361,7 @@ static int pic32_spi_dma_config(struct pic32_spi *pic32s, u32 dma_width) struct dma_slave_config cfg; int ret; + memset(&cfg, 0, sizeof(cfg)); cfg.device_fc = true; cfg.src_addr = pic32s->dma_base + buf_offset; cfg.dst_addr = pic32s->dma_base + buf_offset; -- 2.30.2