From patchwork Wed Sep 14 10:10:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 9331123 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CABAF6077A for ; Wed, 14 Sep 2016 10:10:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC83029C32 for ; Wed, 14 Sep 2016 10:10:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B047429C38; Wed, 14 Sep 2016 10:10:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5554129C40 for ; Wed, 14 Sep 2016 10:10:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750975AbcINKK6 (ORCPT ); Wed, 14 Sep 2016 06:10:58 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:44238 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760751AbcINKK4 (ORCPT ); Wed, 14 Sep 2016 06:10:56 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id u8EAAfON003361; Wed, 14 Sep 2016 05:10:41 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u8EAAeVI007100; Wed, 14 Sep 2016 05:10:40 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.294.0; Wed, 14 Sep 2016 05:10:39 -0500 Received: from dlep32.itg.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u8EAAb1V027544; Wed, 14 Sep 2016 05:10:38 -0500 From: Peter Ujfalusi To: CC: , , , , Subject: [PATCH] mmc: omap: Initialize dma_slave_config to avoid random data in it's fields Date: Wed, 14 Sep 2016 13:10:35 +0300 Message-ID: <20160914101035.972-1-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.10.0 MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is wrong to not initialize the dma_slave_config struct as the DMAengine driver might look at non initialized (random data) fields and tries to interpret it. Signed-off-by: Peter Ujfalusi --- Hi, would it be possible to send this patch for 4.8? I have omap-dma DMAengine driver changes pending, but they break the MMC/SD because of the uninitialized fields in dma_slave_config. Thanks, Peter drivers/mmc/host/omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.10.0 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index f23d65eb070d..b49b3fa740a5 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c @@ -1016,7 +1016,7 @@ mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request *req) /* Only reconfigure if we have a different burst size */ if (*bp != burst) { - struct dma_slave_config cfg; + struct dma_slave_config cfg = {}; cfg.src_addr = host->phys_base + OMAP_MMC_REG(host, DATA); cfg.dst_addr = host->phys_base + OMAP_MMC_REG(host, DATA);