From patchwork Sun Aug 19 08:44:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 1344011 Return-Path: X-Original-To: patchwork-spi-devel-general@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by patchwork1.kernel.org (Postfix) with ESMTP id 1179E3FC33 for ; Sun, 19 Aug 2012 08:44:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1T317o-0001wy-Q4; Sun, 19 Aug 2012 08:44:48 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1T317n-0001wd-IF for spi-devel-general@lists.sourceforge.net; Sun, 19 Aug 2012 08:44:47 +0000 Received-SPF: neutral (sog-mx-4.v43.ch3.sourceforge.com: 192.134.164.82 is neither permitted nor denied by domain of lip6.fr) client-ip=192.134.164.82; envelope-from=Julia.Lawall@lip6.fr; helo=mail1-relais-roc.national.inria.fr; Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1T317m-0004iB-JY for spi-devel-general@lists.sourceforge.net; Sun, 19 Aug 2012 08:44:47 +0000 X-IronPort-AV: E=Sophos;i="4.77,792,1336341600"; d="scan'208";a="170216902" Received: from palace.lip6.fr (HELO localhost.localdomain) ([132.227.105.202]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 Aug 2012 10:44:37 +0200 From: Julia Lawall To: Grant Likely Subject: [PATCH 10/14] drivers/spi/spi-ep93xx.c: fix error return code Date: Sun, 19 Aug 2012 10:44:27 +0200 Message-Id: <1345365870-29831-12-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1345365870-29831-1-git-send-email-Julia.Lawall@lip6.fr> References: <1345365870-29831-1-git-send-email-Julia.Lawall@lip6.fr> X-Spam-Score: 0.3 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) -0.3 AWL AWL: From: address is in the auto white-list X-Headers-End: 1T317m-0004iB-JY Cc: spi-devel-general@lists.sourceforge.net, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net From: Julia Lawall Initialize return variable before exiting on an error path. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // Signed-off-by: Julia Lawall Reviewed-by: H Hartley Sweeten --- drivers/spi/spi-ep93xx.c | 1 + 1 file changed, 1 insertion(+) ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c index f97f1d2..9e7fdfd 100644 --- a/drivers/spi/spi-ep93xx.c +++ b/drivers/spi/spi-ep93xx.c @@ -1105,6 +1105,7 @@ static int __devinit ep93xx_spi_probe(struct platform_device *pdev) espi->wq = create_singlethread_workqueue("ep93xx_spid"); if (!espi->wq) { dev_err(&pdev->dev, "unable to create workqueue\n"); + error = -ENOMEM; goto fail_free_dma; } INIT_WORK(&espi->msg_work, ep93xx_spi_work);