From patchwork Wed Aug 22 11:42:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 1361041 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 431473FC71 for ; Wed, 22 Aug 2012 11:43:02 +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 1T49Kv-00043v-Nm; Wed, 22 Aug 2012 11:43:01 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1T49Ku-00043m-Fv for spi-devel-general@lists.sourceforge.net; Wed, 22 Aug 2012 11:43:00 +0000 Received-SPF: neutral (sog-mx-1.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-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1T49Ko-0002L9-P8 for spi-devel-general@lists.sourceforge.net; Wed, 22 Aug 2012 11:43:00 +0000 X-IronPort-AV: E=Sophos;i="4.77,808,1336341600"; d="scan'208";a="170506400" Received: from technetium.rsr.lip6.fr ([132.227.76.37]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Aug 2012 13:42:48 +0200 Date: Wed, 22 Aug 2012 13:42:47 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Mark Brown Subject: Re: [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code In-Reply-To: <20120822114015.GI7995@opensource.wolfsonmicro.com> Message-ID: References: <1345365870-29831-1-git-send-email-Julia.Lawall@lip6.fr> <1345365870-29831-15-git-send-email-Julia.Lawall@lip6.fr> <1b3201cd8049$e753f720$b5fbe560$%kim@samsung.com> <20120822114015.GI7995@opensource.wolfsonmicro.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-Spam-Score: 0.4 (/) 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: 1T49Ko-0002L9-P8 Cc: Kukjin Kim , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, 'Julia Lawall' , linux-samsung-soc@vger.kernel.org, 'Ben Dooks' , spi-devel-general@lists.sourceforge.net, linux-arm-kernel@lists.infradead.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: , 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 --- Perhaps -EINVAL is not the right value in this case. drivers/spi/spi-s3c24xx.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-s3c24xx.c b/drivers/spi/spi-s3c24xx.c index 8ee7d79..a2a080b 100644 --- a/drivers/spi/spi-s3c24xx.c +++ b/drivers/spi/spi-s3c24xx.c @@ -611,6 +611,7 @@ static int __devinit s3c24xx_spi_probe(struct platform_device *pdev) if (!pdata->set_cs) { if (pdata->pin_cs < 0) { dev_err(&pdev->dev, "No chipselect pin\n"); + err = -EINVAL; goto err_register; }