Commit b2af045c authored by Julia Lawall's avatar Julia Lawall Committed by Mark Brown

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: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent a8e8f139
...@@ -611,6 +611,7 @@ static int __devinit s3c24xx_spi_probe(struct platform_device *pdev) ...@@ -611,6 +611,7 @@ static int __devinit s3c24xx_spi_probe(struct platform_device *pdev)
if (!pdata->set_cs) { if (!pdata->set_cs) {
if (pdata->pin_cs < 0) { if (pdata->pin_cs < 0) {
dev_err(&pdev->dev, "No chipselect pin\n"); dev_err(&pdev->dev, "No chipselect pin\n");
err = -EINVAL;
goto err_register; goto err_register;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment