From patchwork Sun Aug 11 00:33:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2842547 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A0615BF546 for ; Sun, 11 Aug 2013 00:34:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D83CF201D3 for ; Sun, 11 Aug 2013 00:34:41 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DAF27201BD for ; Sun, 11 Aug 2013 00:34:40 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V8Jc4-0002nk-PZ; Sun, 11 Aug 2013 00:34:29 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V8Jc2-0005Pf-AB; Sun, 11 Aug 2013 00:34:26 +0000 Received: from mail-ea0-f169.google.com ([209.85.215.169]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V8Jbr-0005Nm-2q for linux-arm-kernel@lists.infradead.org; Sun, 11 Aug 2013 00:34:16 +0000 Received: by mail-ea0-f169.google.com with SMTP id z7so2751581eaf.0 for ; Sat, 10 Aug 2013 17:33:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=JkJgfl7HhH+HLcenX6JkGBaevTXuGs3ilRWjLIfM1aM=; b=HHH5CwBoltIPoDa3DO/KIQO2729e3j6nuiaxioK8sFhLzlsQhj5CbyyUgezLJgPesH L3rHu9Gzn/+KnOT25QPGp23FcmH9xWMGXB0i5ksHJhSnKvK2kj0jB7SssbhOeoddinAH BbCg8CzPcbVx2imCf/PAJcdaxAeujbO3uxOm5e87z8ao1RrzGjL1wXIxsGKuo7QKkQHD Mmykbje2wMoiISg1ut88WZrFWSTSpWXBO6wRo/R1QY9aRuSSJmOL7GUZmyX7XH0kLdIu q87lDWXJEdv8qkP52MVGtcyIxAEXG6VaTpxtTbdoFA6OKRJsY2BqcwcEG9NHzDKKL2N9 LFwQ== X-Received: by 10.14.8.199 with SMTP id 47mr6651071eer.101.1376181228701; Sat, 10 Aug 2013 17:33:48 -0700 (PDT) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id r48sm36159729eev.14.2013.08.10.17.33.46 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 10 Aug 2013 17:33:47 -0700 (PDT) From: Tomasz Figa To: linux-spi@vger.kernel.org Subject: [PATCH 1/3] spi: s3c64xx: Zero dma_slave_config struct in prepare_dma() Date: Sun, 11 Aug 2013 02:33:28 +0200 Message-Id: <1376181210-14599-1-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.3.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130810_203415_260271_20965F9D X-CRM114-Status: UNSURE ( 9.42 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.7 (--) Cc: Kukjin Kim , Mark Brown , linux-samsung-soc@vger.kernel.org, Tomasz Figa , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Not all fields of dma_slave_config struct are being initialized by prepare_dma() function, leaving those which are not in undefined state, which can confuse DMA drivers using them. This patch adds call to memset() to zero the struct before initializing a subset of its fields. Signed-off-by: Tomasz Figa --- drivers/spi/spi-s3c64xx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 62f32c4..1be162c 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -389,6 +389,8 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma, struct scatterlist sg; struct dma_async_tx_descriptor *desc; + memset(&config, 0, sizeof(config)); + if (dma->direction == DMA_DEV_TO_MEM) { sdd = container_of((void *)dma, struct s3c64xx_spi_driver_data, rx_dma);