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: 2842544 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 DA56DBF546 for ; Sun, 11 Aug 2013 00:33:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0D94C2020E for ; Sun, 11 Aug 2013 00:33:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3050D2020A for ; Sun, 11 Aug 2013 00:33:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751117Ab3HKAdv (ORCPT ); Sat, 10 Aug 2013 20:33:51 -0400 Received: from mail-ea0-f181.google.com ([209.85.215.181]:52480 "EHLO mail-ea0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750990Ab3HKAdu (ORCPT ); Sat, 10 Aug 2013 20:33:50 -0400 Received: by mail-ea0-f181.google.com with SMTP id d10so2759313eaj.40 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 Cc: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kukjin Kim , Mark Brown , Tomasz Figa 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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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);