From b2af045c70aa60f7231b22a363d74a1ab5a6297b Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Wed, 22 Aug 2012 13:42:47 +0200 Subject: 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/) // ( 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 Signed-off-by: Mark Brown --- drivers/spi/spi-s3c24xx.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/spi/spi-s3c24xx.c') 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; } -- cgit v1.2.3