summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2012-08-22 13:42:47 +0200
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-08-22 18:58:01 +0200
commitb2af045c70aa60f7231b22a363d74a1ab5a6297b (patch)
treef3eb0bdf36fe22762b85260d9ae8822d09a00390 /drivers/spi
parentspi: omap2-mcspi: Remove the call to platform_set_drvdata(pdev, NULL) (diff)
downloadlinux-b2af045c70aa60f7231b22a363d74a1ab5a6297b.tar.xz
linux-b2af045c70aa60f7231b22a363d74a1ab5a6297b.zip
drivers/spi/spi-s3c24xx.c: fix error return code
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/) // <smpl> ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-s3c24xx.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/spi/spi-s3c24xx.c b/drivers/spi/spi-s3c24xx.c
index 8ee7d790ce49..a2a080b7f42b 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;
}