From patchwork Wed Aug 8 14:47:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 1296281 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id C1BBE3FC23 for ; Wed, 8 Aug 2012 14:52:29 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Sz7Y8-0005Kv-TP; Wed, 08 Aug 2012 14:47:53 +0000 Received: from moutng.kundenserver.de ([212.227.17.10]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Sz7Xu-0005HM-1H for linux-arm-kernel@lists.infradead.org; Wed, 08 Aug 2012 14:47:39 +0000 Received: from klappe2.boeblingen.de.ibm.com (deibp9eh1--blueice3n2.emea.ibm.com [195.212.29.180]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0Lxdhj-1TnSHy0bMJ-016VId; Wed, 08 Aug 2012 16:47:37 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 10/11] spi/s3c64xx: improve error handling Date: Wed, 8 Aug 2012 16:47:27 +0200 Message-Id: <1344437248-20560-11-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1344437248-20560-1-git-send-email-arnd@arndb.de> References: <1344437248-20560-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:jPfMJYg6Tt3TUZQHV9OqzBL3ugzKBlD7Mq30WY1xr7s Q5PLzb9GCT9GJpUcALNLw8ekWrOecNDohv4wiZM7louDitCJC1 m5OP85Sx7AfLsJAgwi6FxmqQJZ/SzDhZ3FZkoEdVjHVZWAhQX5 F8ZUp2X38FVUnxZ0eJJByZGXRvoMTaJjTjMVu1tktWeOvWZrEL Vt4p+ksQ8QDiIUeZEKqKKWliRy91dWNYyJ0/jCXoKbSp84ITAq v8Q0yE0P9FqTxkzn3izKJWOFysOps398HyezC6yxhxUm5ZwpUn JGTBzGmO+EfqvduOsDicxaWAanVlGhcnEzjWhLwELFpL9yNIbD FLKDJXzwNAj7cnVIGl23WY57G/F8djoMTLiykceL02xLpZxJbY ohIdMrIxMgLwsFCodB/HjyMPup0L4MbSYM= X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.10 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Kukjin Kim , Arnd Bergmann , linux-kernel@vger.kernel.org, Grant Likely , Jaswinder Singh , arm@kernel.org, Thomas Abraham X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org When a device tree definition os an s3c64xx SPI master is missing a "controller-data" subnode, the newly added s3c64xx_get_slave_ctrldata function might use uninitialized memory in place of that node, which was correctly reported by gcc. Without this patch, building s3c6400_defconfig results in: drivers/spi/spi-s3c64xx.c: In function 's3c64xx_get_slave_ctrldata.isra.25': drivers/spi/spi-s3c64xx.c:841:5: warning: 'data_np' may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Arnd Bergmann Cc: Thomas Abraham Cc: Jaswinder Singh Cc: Grant Likely Cc: Kukjin Kim Acked-by: Thomas Abraham --- drivers/spi/spi-s3c64xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 646a765..cfa2c35 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -826,7 +826,7 @@ static struct s3c64xx_spi_csinfo *s3c64xx_get_slave_ctrldata( struct spi_device *spi) { struct s3c64xx_spi_csinfo *cs; - struct device_node *slave_np, *data_np; + struct device_node *slave_np, *data_np = NULL; u32 fb_delay = 0; slave_np = spi->dev.of_node;