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: 10591 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 681C823E53 for ; Wed, 8 Aug 2012 14:47:47 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 385B9A190AC for ; Wed, 8 Aug 2012 14:47:47 +0000 (UTC) Received: by mail-gg0-f180.google.com with SMTP id f1so837495ggn.11 for ; Wed, 08 Aug 2012 07:47:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-provags-id:x-gm-message-state; bh=A5Ar8zmbPhHLqiBXmAU7UfSONfPUeup2CJBNVv66oH4=; b=L3i7gyITf8WvBNB/KhJybhUIEGsD6exloE3J74tTkvR0kIoMbkZyG0ODPI/crAY3ZA +rF2swU2mmEVEbLqciODdX7PXULwpsTwRk7jFJF6ArxeH+lSKIV6zokUZn+csmYnlI+S w8MNUSHrerHiYAroPqjJZgUs66U9qFMArJ3M9gg2GSx7pmaxQtDR87C6I0h5XgalIgav MFZ++LWmO7rTIAKcGoRXlnRUc6NRME6uygRHyl9O6lQznYoXy35bDwgVc3N17XRI5/aI okdQSi08L2Mc01+5GAjU3AtOWRTIAPkSZ6IYtGbGAvn3H9CxRqThoTQOc7LLuwE4fT7X Aesg== Received: by 10.42.75.73 with SMTP id z9mr14264939icj.46.1344437265670; Wed, 08 Aug 2012 07:47:45 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.200 with SMTP id ew8csp611875igc; Wed, 8 Aug 2012 07:47:44 -0700 (PDT) Received: by 10.216.15.73 with SMTP id e51mr6063395wee.37.1344437264009; Wed, 08 Aug 2012 07:47:44 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.17.10]) by mx.google.com with ESMTP id g3si6916312wie.33.2012.08.08.07.47.43; Wed, 08 Aug 2012 07:47:44 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.17.10 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.17.10; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.17.10 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mail=arnd@arndb.de 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 Cc: arm@kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Thomas Abraham , Jaswinder Singh , Grant Likely , Kukjin Kim 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-Gm-Message-State: ALoCoQnXlcwLI2Lr5nrmAe/fBrgnXCwpVP9wErZ/SX5nbX6bVIRABoqwRzGo6N9yGTocbVMyWDyi 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 --- 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;