All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/14] fix error return code
@ 2012-08-19  8:44 ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors

These patches fix cases where the return code appears to be unintentially
nonnegative.

The complete semantic match that finds the problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@ok exists@
identifier f,ret,i;
expression e;
constant c;
@@

f(...) {
<+...
(
return -c@i;
|
ret = -c@i;
... when != ret = e
return ret;
|
if (ret < 0) { ... return ret; }
)
...+> }

@r exists@
identifier ret,l,ok.f;
expression e1,e2,e3;
statement S;
position p1,p2,p3;
@@

f(...) {
... when any
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
(
 if (<+... ret = e3 ...+>) S
|
 if (<+... &ret ...+>) S
|
if@p2(...)
 {
  ... when != ret = e2
      when forall
 return@p3 ret;
}
)
... when any
}

@bad exists@
position r.p1,r.p2;
statement S1,S2;
identifier r.ret;
expression e1;
@@

(
if@p1 (\(ret < 0\|ret != 0\)) S1
|
ret@p1 = 0
)
... when any
ret = e1
... when any
if@p2(...) S2

@bad2@
position r.p1,r.p2;
identifier r.ret;
expression e1;
statement S2;
@@

ret@p1 = 0
... when != if (...) { ... ret = e1 ... return ret; }
    when any
if@p2(...) S2


@script:python depends on !bad && !bad2@
p1 << r.p1;
p2 << r.p2;
p3 << r.p3;
@@

cocci.print_main("",p1)
cocci.print_secs("",p2)
cocci.print_secs("",p3)
// </smpl>


^ permalink raw reply	[flat|nested] 62+ messages in thread

* [PATCH 0/14] fix error return code
@ 2012-08-19  8:44 ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors

These patches fix cases where the return code appears to be unintentially
nonnegative.

The complete semantic match that finds the problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@ok exists@
identifier f,ret,i;
expression e;
constant c;
@@

f(...) {
<+...
(
return -c@i;
|
ret = -c@i;
... when != ret = e
return ret;
|
if (ret < 0) { ... return ret; }
)
...+> }

@r exists@
identifier ret,l,ok.f;
expression e1,e2,e3;
statement S;
position p1,p2,p3;
@@

f(...) {
... when any
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
(
 if (<+... ret = e3 ...+>) S
|
 if (<+... &ret ...+>) S
|
if@p2(...)
 {
  ... when != ret = e2
      when forall
 return@p3 ret;
}
)
... when any
}

@bad exists@
position r.p1,r.p2;
statement S1,S2;
identifier r.ret;
expression e1;
@@

(
if@p1 (\(ret < 0\|ret != 0\)) S1
|
ret@p1 = 0
)
... when any
ret = e1
... when any
if@p2(...) S2

@bad2@
position r.p1,r.p2;
identifier r.ret;
expression e1;
statement S2;
@@

ret@p1 = 0
... when != if (...) { ... ret = e1 ... return ret; }
    when any
if@p2(...) S2


@script:python depends on !bad && !bad2@
p1 << r.p1;
p2 << r.p2;
p3 << r.p3;
@@

cocci.print_main("",p1)
cocci.print_secs("",p2)
cocci.print_secs("",p3)
// </smpl>


^ permalink raw reply	[flat|nested] 62+ messages in thread

* [PATCH 1/14] drivers/rpmsg/virtio_rpmsg_bus.c: fix error return code
  2012-08-19  8:44 ` Julia Lawall
@ 2012-08-19  8:44   ` Julia Lawall
  -1 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/rpmsg/virtio_rpmsg_bus.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index 590cfaf..c5e66d9 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -959,8 +959,10 @@ static int rpmsg_probe(struct virtio_device *vdev)
 	bufs_va = dma_alloc_coherent(vdev->dev.parent->parent,
 				RPMSG_TOTAL_BUF_SPACE,
 				&vrp->bufs_dma, GFP_KERNEL);
-	if (!bufs_va)
+	if (!bufs_va) {
+		err = -ENOMEM;
 		goto vqs_del;
+	}
 
 	dev_dbg(&vdev->dev, "buffers: va %p, dma 0x%llx\n", bufs_va,
 					(unsigned long long)vrp->bufs_dma);


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 1/14] drivers/rpmsg/virtio_rpmsg_bus.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/rpmsg/virtio_rpmsg_bus.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index 590cfaf..c5e66d9 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -959,8 +959,10 @@ static int rpmsg_probe(struct virtio_device *vdev)
 	bufs_va = dma_alloc_coherent(vdev->dev.parent->parent,
 				RPMSG_TOTAL_BUF_SPACE,
 				&vrp->bufs_dma, GFP_KERNEL);
-	if (!bufs_va)
+	if (!bufs_va) {
+		err = -ENOMEM;
 		goto vqs_del;
+	}
 
 	dev_dbg(&vdev->dev, "buffers: va %p, dma 0x%llx\n", bufs_va,
 					(unsigned long long)vrp->bufs_dma);


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 6/14] drivers/power/wm97xx_battery.c: fix error return code
  2012-08-19  8:44 ` Julia Lawall
@ 2012-08-19  8:44   ` Julia Lawall
  -1 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: kernel-janitors, David Woodhouse, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/power/wm97xx_battery.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/power/wm97xx_battery.c b/drivers/power/wm97xx_battery.c
index d2d4c08..0ba331a 100644
--- a/drivers/power/wm97xx_battery.c
+++ b/drivers/power/wm97xx_battery.c
@@ -212,8 +212,10 @@ static int __devinit wm97xx_bat_probe(struct platform_device *dev)
 		props++;	/* POWER_SUPPLY_PROP_VOLTAGE_MIN */
 
 	prop = kzalloc(props * sizeof(*prop), GFP_KERNEL);
-	if (!prop)
+	if (!prop) {
+		ret = -ENOMEM;
 		goto err3;
+	}
 
 	prop[i++] = POWER_SUPPLY_PROP_PRESENT;
 	if (pdata->charge_gpio >= 0)


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 6/14] drivers/power/wm97xx_battery.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: kernel-janitors, David Woodhouse, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/power/wm97xx_battery.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/power/wm97xx_battery.c b/drivers/power/wm97xx_battery.c
index d2d4c08..0ba331a 100644
--- a/drivers/power/wm97xx_battery.c
+++ b/drivers/power/wm97xx_battery.c
@@ -212,8 +212,10 @@ static int __devinit wm97xx_bat_probe(struct platform_device *dev)
 		props++;	/* POWER_SUPPLY_PROP_VOLTAGE_MIN */
 
 	prop = kzalloc(props * sizeof(*prop), GFP_KERNEL);
-	if (!prop)
+	if (!prop) {
+		ret = -ENOMEM;
 		goto err3;
+	}
 
 	prop[i++] = POWER_SUPPLY_PROP_PRESENT;
 	if (pdata->charge_gpio >= 0)


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 5/14] drivers/power/ab8500_charger.c: fix error return code
  2012-08-19  8:44 ` Julia Lawall
@ 2012-08-19  8:44   ` Julia Lawall
  -1 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: kernel-janitors, David Woodhouse, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/power/ab8500_charger.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/ab8500_charger.c b/drivers/power/ab8500_charger.c
index d4f0c98..c2ef947 100644
--- a/drivers/power/ab8500_charger.c
+++ b/drivers/power/ab8500_charger.c
@@ -2614,6 +2614,7 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev)
 		create_singlethread_workqueue("ab8500_charger_wq");
 	if (di->charger_wq == NULL) {
 		dev_err(di->dev, "failed to create work queue\n");
+		ret = -ENOMEM;
 		goto free_device_info;
 	}
 


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 5/14] drivers/power/ab8500_charger.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: kernel-janitors, David Woodhouse, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/power/ab8500_charger.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/ab8500_charger.c b/drivers/power/ab8500_charger.c
index d4f0c98..c2ef947 100644
--- a/drivers/power/ab8500_charger.c
+++ b/drivers/power/ab8500_charger.c
@@ -2614,6 +2614,7 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev)
 		create_singlethread_workqueue("ab8500_charger_wq");
 	if (di->charger_wq = NULL) {
 		dev_err(di->dev, "failed to create work queue\n");
+		ret = -ENOMEM;
 		goto free_device_info;
 	}
 


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 4/14] drivers/power/bq27x00_battery.c: fix error return code
  2012-08-19  8:44 ` Julia Lawall
@ 2012-08-19  8:44   ` Julia Lawall
  -1 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: kernel-janitors, David Woodhouse, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/power/bq27x00_battery.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c
index 181ddec..5860d4d 100644
--- a/drivers/power/bq27x00_battery.c
+++ b/drivers/power/bq27x00_battery.c
@@ -814,7 +814,8 @@ static int bq27x00_battery_probe(struct i2c_client *client,
 	di->bat.name = name;
 	di->bus.read = &bq27x00_read_i2c;
 
-	if (bq27x00_powersupply_init(di))
+	retval = bq27x00_powersupply_init(di);
+	if (retval)
 		goto batt_failed_3;
 
 	i2c_set_clientdata(client, di);


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 4/14] drivers/power/bq27x00_battery.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: kernel-janitors, David Woodhouse, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/power/bq27x00_battery.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c
index 181ddec..5860d4d 100644
--- a/drivers/power/bq27x00_battery.c
+++ b/drivers/power/bq27x00_battery.c
@@ -814,7 +814,8 @@ static int bq27x00_battery_probe(struct i2c_client *client,
 	di->bat.name = name;
 	di->bus.read = &bq27x00_read_i2c;
 
-	if (bq27x00_powersupply_init(di))
+	retval = bq27x00_powersupply_init(di);
+	if (retval)
 		goto batt_failed_3;
 
 	i2c_set_clientdata(client, di);


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 3/14] drivers/power/ab8500_fg.c: fix error return code
  2012-08-19  8:44 ` Julia Lawall
@ 2012-08-19  8:44   ` Julia Lawall
  -1 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: kernel-janitors, David Woodhouse, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/power/ab8500_fg.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c
index bf02225..11633e3 100644
--- a/drivers/power/ab8500_fg.c
+++ b/drivers/power/ab8500_fg.c
@@ -2506,6 +2506,7 @@ static int __devinit ab8500_fg_probe(struct platform_device *pdev)
 	di->fg_wq = create_singlethread_workqueue("ab8500_fg_wq");
 	if (di->fg_wq == NULL) {
 		dev_err(di->dev, "failed to create work queue\n");
+		ret = -ENOMEM;
 		goto free_device_info;
 	}
 


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 3/14] drivers/power/ab8500_fg.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: kernel-janitors, David Woodhouse, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/power/ab8500_fg.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c
index bf02225..11633e3 100644
--- a/drivers/power/ab8500_fg.c
+++ b/drivers/power/ab8500_fg.c
@@ -2506,6 +2506,7 @@ static int __devinit ab8500_fg_probe(struct platform_device *pdev)
 	di->fg_wq = create_singlethread_workqueue("ab8500_fg_wq");
 	if (di->fg_wq = NULL) {
 		dev_err(di->dev, "failed to create work queue\n");
+		ret = -ENOMEM;
 		goto free_device_info;
 	}
 


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 2/14] drivers/power/ab8500_btemp.c: fix error return code
  2012-08-19  8:44 ` Julia Lawall
@ 2012-08-19  8:44   ` Julia Lawall
  -1 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: kernel-janitors, David Woodhouse, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/power/ab8500_btemp.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/ab8500_btemp.c b/drivers/power/ab8500_btemp.c
index bba3cca..2b76943 100644
--- a/drivers/power/ab8500_btemp.c
+++ b/drivers/power/ab8500_btemp.c
@@ -1014,6 +1014,7 @@ static int __devinit ab8500_btemp_probe(struct platform_device *pdev)
 		create_singlethread_workqueue("ab8500_btemp_wq");
 	if (di->btemp_wq == NULL) {
 		dev_err(di->dev, "failed to create work queue\n");
+		ret = -ENOMEM;
 		goto free_device_info;
 	}
 


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 2/14] drivers/power/ab8500_btemp.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: kernel-janitors, David Woodhouse, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/power/ab8500_btemp.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/ab8500_btemp.c b/drivers/power/ab8500_btemp.c
index bba3cca..2b76943 100644
--- a/drivers/power/ab8500_btemp.c
+++ b/drivers/power/ab8500_btemp.c
@@ -1014,6 +1014,7 @@ static int __devinit ab8500_btemp_probe(struct platform_device *pdev)
 		create_singlethread_workqueue("ab8500_btemp_wq");
 	if (di->btemp_wq = NULL) {
 		dev_err(di->dev, "failed to create work queue\n");
+		ret = -ENOMEM;
 		goto free_device_info;
 	}
 


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 7/14] drivers/mtd/maps/rbtx4939-flash.c: delete unneeded test
  2012-08-19  8:44 ` Julia Lawall
  (?)
@ 2012-08-19  8:44   ` Julia Lawall
  -1 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: David Woodhouse; +Cc: kernel-janitors, linux-mtd, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Err has only been initialized to 0 at this, so it is not possible that this
test can be true.

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>

---
 drivers/mtd/maps/rbtx4939-flash.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/mtd/maps/rbtx4939-flash.c b/drivers/mtd/maps/rbtx4939-flash.c
index 6f52e1f..49c3fe7 100644
--- a/drivers/mtd/maps/rbtx4939-flash.c
+++ b/drivers/mtd/maps/rbtx4939-flash.c
@@ -100,8 +100,6 @@ static int rbtx4939_flash_probe(struct platform_device *dev)
 		goto err_out;
 	}
 	info->mtd->owner = THIS_MODULE;
-	if (err)
-		goto err_out;
 	err = mtd_device_parse_register(info->mtd, NULL, NULL, pdata->parts,
 					pdata->nr_parts);
 


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 7/14] drivers/mtd/maps/rbtx4939-flash.c: delete unneeded test
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: David Woodhouse; +Cc: linux-mtd, kernel-janitors, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Err has only been initialized to 0 at this, so it is not possible that this
test can be true.

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>

---
 drivers/mtd/maps/rbtx4939-flash.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/mtd/maps/rbtx4939-flash.c b/drivers/mtd/maps/rbtx4939-flash.c
index 6f52e1f..49c3fe7 100644
--- a/drivers/mtd/maps/rbtx4939-flash.c
+++ b/drivers/mtd/maps/rbtx4939-flash.c
@@ -100,8 +100,6 @@ static int rbtx4939_flash_probe(struct platform_device *dev)
 		goto err_out;
 	}
 	info->mtd->owner = THIS_MODULE;
-	if (err)
-		goto err_out;
 	err = mtd_device_parse_register(info->mtd, NULL, NULL, pdata->parts,
 					pdata->nr_parts);
 


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 7/14] drivers/mtd/maps/rbtx4939-flash.c: delete unneeded test
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: David Woodhouse; +Cc: linux-mtd, kernel-janitors, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Err has only been initialized to 0 at this, so it is not possible that this
test can be true.

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>

---
 drivers/mtd/maps/rbtx4939-flash.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/mtd/maps/rbtx4939-flash.c b/drivers/mtd/maps/rbtx4939-flash.c
index 6f52e1f..49c3fe7 100644
--- a/drivers/mtd/maps/rbtx4939-flash.c
+++ b/drivers/mtd/maps/rbtx4939-flash.c
@@ -100,8 +100,6 @@ static int rbtx4939_flash_probe(struct platform_device *dev)
 		goto err_out;
 	}
 	info->mtd->owner = THIS_MODULE;
-	if (err)
-		goto err_out;
 	err = mtd_device_parse_register(info->mtd, NULL, NULL, pdata->parts,
 					pdata->nr_parts);
 

^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 8/14] drivers/video/sunxvr2500.c: fix error return code
  2012-08-19  8:44 ` Julia Lawall
@ 2012-08-19  8:44   ` Julia Lawall
  -1 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Florian Tobias Schandinat; +Cc: kernel-janitors, linux-fbdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/video/sunxvr2500.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/video/sunxvr2500.c b/drivers/video/sunxvr2500.c
index 5848436..7fbcba8 100644
--- a/drivers/video/sunxvr2500.c
+++ b/drivers/video/sunxvr2500.c
@@ -181,8 +181,10 @@ static int __devinit s3d_pci_register(struct pci_dev *pdev,
 	sp->fb_size = info->fix.line_length * sp->height;
 
 	sp->fb_base = ioremap(sp->fb_base_phys, sp->fb_size);
-	if (!sp->fb_base)
+	if (!sp->fb_base) {
+		err = -ENOMEM;
 		goto err_release_pci;
+	}
 
 	err = s3d_set_fbinfo(sp);
 	if (err)


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 8/14] drivers/video/sunxvr2500.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Florian Tobias Schandinat; +Cc: kernel-janitors, linux-fbdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/video/sunxvr2500.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/video/sunxvr2500.c b/drivers/video/sunxvr2500.c
index 5848436..7fbcba8 100644
--- a/drivers/video/sunxvr2500.c
+++ b/drivers/video/sunxvr2500.c
@@ -181,8 +181,10 @@ static int __devinit s3d_pci_register(struct pci_dev *pdev,
 	sp->fb_size = info->fix.line_length * sp->height;
 
 	sp->fb_base = ioremap(sp->fb_base_phys, sp->fb_size);
-	if (!sp->fb_base)
+	if (!sp->fb_base) {
+		err = -ENOMEM;
 		goto err_release_pci;
+	}
 
 	err = s3d_set_fbinfo(sp);
 	if (err)


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 12/14] drivers/spi/spi-coldfire-qspi.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Grant Likely; +Cc: kernel-janitors, spi-devel-general, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/spi/spi-coldfire-qspi.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c
index b2d4b9e..7889796 100644
--- a/drivers/spi/spi-coldfire-qspi.c
+++ b/drivers/spi/spi-coldfire-qspi.c
@@ -462,6 +462,7 @@ static int __devinit mcfqspi_probe(struct platform_device *pdev)
 	pdata = pdev->dev.platform_data;
 	if (!pdata) {
 		dev_dbg(&pdev->dev, "platform data is missing\n");
+		status = -EINVAL;
 		goto fail4;
 	}
 	master->bus_num = pdata->bus_num;


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 12/14] drivers/spi/spi-coldfire-qspi.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Grant Likely
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/spi/spi-coldfire-qspi.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c
index b2d4b9e..7889796 100644
--- a/drivers/spi/spi-coldfire-qspi.c
+++ b/drivers/spi/spi-coldfire-qspi.c
@@ -462,6 +462,7 @@ static int __devinit mcfqspi_probe(struct platform_device *pdev)
 	pdata = pdev->dev.platform_data;
 	if (!pdata) {
 		dev_dbg(&pdev->dev, "platform data is missing\n");
+		status = -EINVAL;
 		goto fail4;
 	}
 	master->bus_num = pdata->bus_num;


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 12/14] drivers/spi/spi-coldfire-qspi.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Grant Likely
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

From: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>

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-L2FTfq7BK8M@public.gmane.org>

---
 drivers/spi/spi-coldfire-qspi.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c
index b2d4b9e..7889796 100644
--- a/drivers/spi/spi-coldfire-qspi.c
+++ b/drivers/spi/spi-coldfire-qspi.c
@@ -462,6 +462,7 @@ static int __devinit mcfqspi_probe(struct platform_device *pdev)
 	pdata = pdev->dev.platform_data;
 	if (!pdata) {
 		dev_dbg(&pdev->dev, "platform data is missing\n");
+		status = -EINVAL;
 		goto fail4;
 	}
 	master->bus_num = pdata->bus_num;


------------------------------------------------------------------------------
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/

^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 11/14] drivers/spi/spi-orion.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Grant Likely; +Cc: kernel-janitors, spi-devel-general, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
Actually, orion_spi_reset currently always returns 0, so the test is
never true.  Perhaps this should be taken into account in some other way.

 drivers/spi/spi-orion.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index b17c09c..cc12803 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -435,7 +435,8 @@ static int __init orion_spi_probe(struct platform_device *pdev)
 	}
 	spi->base = ioremap(r->start, SZ_1K);
 
-	if (orion_spi_reset(spi) < 0)
+	status = orion_spi_reset(spi);
+	if (status < 0)
 		goto out_rel_mem;
 
 	master->dev.of_node = pdev->dev.of_node;


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 11/14] drivers/spi/spi-orion.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Grant Likely
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
Actually, orion_spi_reset currently always returns 0, so the test is
never true.  Perhaps this should be taken into account in some other way.

 drivers/spi/spi-orion.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index b17c09c..cc12803 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -435,7 +435,8 @@ static int __init orion_spi_probe(struct platform_device *pdev)
 	}
 	spi->base = ioremap(r->start, SZ_1K);
 
-	if (orion_spi_reset(spi) < 0)
+	status = orion_spi_reset(spi);
+	if (status < 0)
 		goto out_rel_mem;
 
 	master->dev.of_node = pdev->dev.of_node;


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 11/14] drivers/spi/spi-orion.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Grant Likely
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

From: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>

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-L2FTfq7BK8M@public.gmane.org>

---
Actually, orion_spi_reset currently always returns 0, so the test is
never true.  Perhaps this should be taken into account in some other way.

 drivers/spi/spi-orion.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index b17c09c..cc12803 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -435,7 +435,8 @@ static int __init orion_spi_probe(struct platform_device *pdev)
 	}
 	spi->base = ioremap(r->start, SZ_1K);
 
-	if (orion_spi_reset(spi) < 0)
+	status = orion_spi_reset(spi);
+	if (status < 0)
 		goto out_rel_mem;
 
 	master->dev.of_node = pdev->dev.of_node;


------------------------------------------------------------------------------
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/

^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 10/14] drivers/spi/spi-ep93xx.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Grant Likely; +Cc: kernel-janitors, spi-devel-general, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/spi/spi-ep93xx.c |    1 +
 1 file changed, 1 insertion(+)

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);


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 10/14] drivers/spi/spi-ep93xx.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Grant Likely
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/spi/spi-ep93xx.c |    1 +
 1 file changed, 1 insertion(+)

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);


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 10/14] drivers/spi/spi-ep93xx.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Grant Likely
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

From: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>

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-L2FTfq7BK8M@public.gmane.org>

---
 drivers/spi/spi-ep93xx.c |    1 +
 1 file changed, 1 insertion(+)

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);


------------------------------------------------------------------------------
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/

^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 9/14] drivers/spi/spi-omap-100k.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Grant Likely; +Cc: kernel-janitors, spi-devel-general, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
Actually, omap1_spi100k_reset currently always returns 0, so the test is
never true.  Perhaps this should be taken into account in some other way.

 drivers/spi/spi-omap-100k.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c
index 9bd1c92..b581107 100644
--- a/drivers/spi/spi-omap-100k.c
+++ b/drivers/spi/spi-omap-100k.c
@@ -542,7 +542,8 @@ static int __devinit omap1_spi100k_probe(struct platform_device *pdev)
 		goto err2;
 	}
 
-	if (omap1_spi100k_reset(spi100k) < 0)
+	status = omap1_spi100k_reset(spi100k);
+	if (status < 0)
 		goto err3;
 
 	status = spi_register_master(master);


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 9/14] drivers/spi/spi-omap-100k.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Grant Likely
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
Actually, omap1_spi100k_reset currently always returns 0, so the test is
never true.  Perhaps this should be taken into account in some other way.

 drivers/spi/spi-omap-100k.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c
index 9bd1c92..b581107 100644
--- a/drivers/spi/spi-omap-100k.c
+++ b/drivers/spi/spi-omap-100k.c
@@ -542,7 +542,8 @@ static int __devinit omap1_spi100k_probe(struct platform_device *pdev)
 		goto err2;
 	}
 
-	if (omap1_spi100k_reset(spi100k) < 0)
+	status = omap1_spi100k_reset(spi100k);
+	if (status < 0)
 		goto err3;
 
 	status = spi_register_master(master);


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 9/14] drivers/spi/spi-omap-100k.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Grant Likely
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

From: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>

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-L2FTfq7BK8M@public.gmane.org>

---
Actually, omap1_spi100k_reset currently always returns 0, so the test is
never true.  Perhaps this should be taken into account in some other way.

 drivers/spi/spi-omap-100k.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c
index 9bd1c92..b581107 100644
--- a/drivers/spi/spi-omap-100k.c
+++ b/drivers/spi/spi-omap-100k.c
@@ -542,7 +542,8 @@ static int __devinit omap1_spi100k_probe(struct platform_device *pdev)
 		goto err2;
 	}
 
-	if (omap1_spi100k_reset(spi100k) < 0)
+	status = omap1_spi100k_reset(spi100k);
+	if (status < 0)
 		goto err3;
 
 	status = spi_register_master(master);


------------------------------------------------------------------------------
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/

^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 13/14] drivers/mtd/ubi/build.c: fix error return code
  2012-08-19  8:44 ` Julia Lawall
  (?)
@ 2012-08-19  8:44   ` Julia Lawall
  -1 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Artem Bityutskiy
  Cc: kernel-janitors, David Woodhouse, linux-mtd, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/mtd/ubi/build.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 7b6b5f9..afe9075 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -1159,8 +1159,10 @@ static int __init ubi_init(void)
 	ubi_wl_entry_slab = kmem_cache_create("ubi_wl_entry_slab",
 					      sizeof(struct ubi_wl_entry),
 					      0, 0, NULL);
-	if (!ubi_wl_entry_slab)
+	if (!ubi_wl_entry_slab) {
+		err = -ENOMEM;
 		goto out_dev_unreg;
+	}
 
 	err = ubi_debugfs_init();
 	if (err)


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 13/14] drivers/mtd/ubi/build.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Artem Bityutskiy
  Cc: David Woodhouse, kernel-janitors, linux-kernel, linux-mtd

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/mtd/ubi/build.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 7b6b5f9..afe9075 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -1159,8 +1159,10 @@ static int __init ubi_init(void)
 	ubi_wl_entry_slab = kmem_cache_create("ubi_wl_entry_slab",
 					      sizeof(struct ubi_wl_entry),
 					      0, 0, NULL);
-	if (!ubi_wl_entry_slab)
+	if (!ubi_wl_entry_slab) {
+		err = -ENOMEM;
 		goto out_dev_unreg;
+	}
 
 	err = ubi_debugfs_init();
 	if (err)


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 13/14] drivers/mtd/ubi/build.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Artem Bityutskiy
  Cc: David Woodhouse, kernel-janitors, linux-kernel, linux-mtd

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
 drivers/mtd/ubi/build.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 7b6b5f9..afe9075 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -1159,8 +1159,10 @@ static int __init ubi_init(void)
 	ubi_wl_entry_slab = kmem_cache_create("ubi_wl_entry_slab",
 					      sizeof(struct ubi_wl_entry),
 					      0, 0, NULL);
-	if (!ubi_wl_entry_slab)
+	if (!ubi_wl_entry_slab) {
+		err = -ENOMEM;
 		goto out_dev_unreg;
+	}
 
 	err = ubi_debugfs_init();
 	if (err)

^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code
  2012-08-19  8:44 ` Julia Lawall
  (?)
  (?)
@ 2012-08-19  8:44   ` Julia Lawall
  -1 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Ben Dooks
  Cc: kernel-janitors, Kukjin Kim, Grant Likely, linux-arm-kernel,
	linux-samsung-soc, spi-devel-general, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
Perhaps -EINVAL is not the right value in this case.

 drivers/spi/spi-s3c24xx.c |    1 +
 1 file changed, 1 insertion(+)

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;
 		}
 


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: linux-arm-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
Perhaps -EINVAL is not the right value in this case.

 drivers/spi/spi-s3c24xx.c |    1 +
 1 file changed, 1 insertion(+)

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;
 		}
 


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: Ben Dooks
  Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Kukjin Kim,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>

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-L2FTfq7BK8M@public.gmane.org>

---
Perhaps -EINVAL is not the right value in this case.

 drivers/spi/spi-s3c24xx.c |    1 +
 1 file changed, 1 insertion(+)

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;
 		}
 


------------------------------------------------------------------------------
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/

^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code
@ 2012-08-19  8:44   ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-19  8:44 UTC (permalink / raw)
  To: linux-arm-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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 at 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>

---
Perhaps -EINVAL is not the right value in this case.

 drivers/spi/spi-s3c24xx.c |    1 +
 1 file changed, 1 insertion(+)

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;
 		}
 

^ permalink raw reply related	[flat|nested] 62+ messages in thread

* RE: [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code
  2012-08-19  8:44   ` Julia Lawall
  (?)
@ 2012-08-22  9:38     ` Kukjin Kim
  -1 siblings, 0 replies; 62+ messages in thread
From: Kukjin Kim @ 2012-08-22  9:38 UTC (permalink / raw)
  To: 'Julia Lawall', 'Ben Dooks'
  Cc: kernel-janitors, 'Grant Likely',
	linux-arm-kernel, linux-samsung-soc, spi-devel-general,
	linux-kernel, 'Mark Brown'

Julia Lawall wrote:
> 
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> 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>
> 
Acked-by: Kukjin Kim <kgene.kim@samsung.com>

(Cc'ed Mark Brown who is handling spi for a moment)

> ---
> Perhaps -EINVAL is not the right value in this case.
> 
Well, if (pin_cs < 0) is true, it is really invalid value. So I think, it
makes sense :-)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

>  drivers/spi/spi-s3c24xx.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> 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;
>  		}
> 


^ permalink raw reply	[flat|nested] 62+ messages in thread

* RE: [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code
@ 2012-08-22  9:38     ` Kukjin Kim
  0 siblings, 0 replies; 62+ messages in thread
From: Kukjin Kim @ 2012-08-22  9:38 UTC (permalink / raw)
  To: linux-arm-kernel

Julia Lawall wrote:
> 
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> 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>
> 
Acked-by: Kukjin Kim <kgene.kim@samsung.com>

(Cc'ed Mark Brown who is handling spi for a moment)

> ---
> Perhaps -EINVAL is not the right value in this case.
> 
Well, if (pin_cs < 0) is true, it is really invalid value. So I think, it
makes sense :-)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

>  drivers/spi/spi-s3c24xx.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> 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;
>  		}
> 


^ permalink raw reply	[flat|nested] 62+ messages in thread

* [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code
@ 2012-08-22  9:38     ` Kukjin Kim
  0 siblings, 0 replies; 62+ messages in thread
From: Kukjin Kim @ 2012-08-22  9:38 UTC (permalink / raw)
  To: linux-arm-kernel

Julia Lawall wrote:
> 
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> 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 at p1 (\(ret < 0\|ret != 0\))
>  { ... return ret; }
> |
> ret at 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>
> 
Acked-by: Kukjin Kim <kgene.kim@samsung.com>

(Cc'ed Mark Brown who is handling spi for a moment)

> ---
> Perhaps -EINVAL is not the right value in this case.
> 
Well, if (pin_cs < 0) is true, it is really invalid value. So I think, it
makes sense :-)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

>  drivers/spi/spi-s3c24xx.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> 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;
>  		}
> 

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code
  2012-08-22  9:38     ` Kukjin Kim
  (?)
@ 2012-08-22 11:40       ` Mark Brown
  -1 siblings, 0 replies; 62+ messages in thread
From: Mark Brown @ 2012-08-22 11:40 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: 'Julia Lawall', 'Ben Dooks',
	kernel-janitors, 'Grant Likely',
	linux-arm-kernel, linux-samsung-soc, spi-devel-general,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 293 bytes --]

On Wed, Aug 22, 2012 at 06:38:36PM +0900, Kukjin Kim wrote:
> Julia Lawall wrote:

> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

> Acked-by: Kukjin Kim <kgene.kim@samsung.com>

> (Cc'ed Mark Brown who is handling spi for a moment)

Please resend the patch to me so I can apply this.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code
@ 2012-08-22 11:40       ` Mark Brown
  0 siblings, 0 replies; 62+ messages in thread
From: Mark Brown @ 2012-08-22 11:40 UTC (permalink / raw)
  To: linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 293 bytes --]

On Wed, Aug 22, 2012 at 06:38:36PM +0900, Kukjin Kim wrote:
> Julia Lawall wrote:

> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

> Acked-by: Kukjin Kim <kgene.kim@samsung.com>

> (Cc'ed Mark Brown who is handling spi for a moment)

Please resend the patch to me so I can apply this.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 62+ messages in thread

* [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code
@ 2012-08-22 11:40       ` Mark Brown
  0 siblings, 0 replies; 62+ messages in thread
From: Mark Brown @ 2012-08-22 11:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Aug 22, 2012 at 06:38:36PM +0900, Kukjin Kim wrote:
> Julia Lawall wrote:

> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

> Acked-by: Kukjin Kim <kgene.kim@samsung.com>

> (Cc'ed Mark Brown who is handling spi for a moment)

Please resend the patch to me so I can apply this.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120822/d8403bd2/attachment.sig>

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code
  2012-08-22 11:40       ` Mark Brown
  (?)
@ 2012-08-22 11:42         ` Julia Lawall
  -1 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-22 11:42 UTC (permalink / raw)
  To: Mark Brown
  Cc: Kukjin Kim, 'Julia Lawall', 'Ben Dooks',
	kernel-janitors, 'Grant Likely',
	linux-arm-kernel, linux-samsung-soc, spi-devel-general,
	linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
Perhaps -EINVAL is not the right value in this case.

 drivers/spi/spi-s3c24xx.c |    1 +
 1 file changed, 1 insertion(+)

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;
 		}



^ permalink raw reply related	[flat|nested] 62+ messages in thread

* Re: [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code
@ 2012-08-22 11:42         ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-22 11:42 UTC (permalink / raw)
  To: linux-arm-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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>

---
Perhaps -EINVAL is not the right value in this case.

 drivers/spi/spi-s3c24xx.c |    1 +
 1 file changed, 1 insertion(+)

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;
 		}



^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code
@ 2012-08-22 11:42         ` Julia Lawall
  0 siblings, 0 replies; 62+ messages in thread
From: Julia Lawall @ 2012-08-22 11:42 UTC (permalink / raw)
  To: linux-arm-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

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 at 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>

---
Perhaps -EINVAL is not the right value in this case.

 drivers/spi/spi-s3c24xx.c |    1 +
 1 file changed, 1 insertion(+)

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;
 		}

^ permalink raw reply related	[flat|nested] 62+ messages in thread

* RE: [PATCH 10/14] drivers/spi/spi-ep93xx.c: fix error return code
  2012-08-19  8:44   ` Julia Lawall
  (?)
@ 2012-08-22 16:12     ` H Hartley Sweeten
  -1 siblings, 0 replies; 62+ messages in thread
From: H Hartley Sweeten @ 2012-08-22 16:12 UTC (permalink / raw)
  To: Julia Lawall, Grant Likely
  Cc: spi-devel-general, kernel-janitors, linux-kernel

On Sunday, August 19, 2012 1:44 AM, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Initialize return variable before exiting on an error path.

<snip>

> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
>  drivers/spi/spi-ep93xx.c |    1 +
>  1 file changed, 1 insertion(+)
>
> 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);

Looks ok to me... Thanks!

Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>

^ permalink raw reply	[flat|nested] 62+ messages in thread

* RE: [PATCH 10/14] drivers/spi/spi-ep93xx.c: fix error return code
@ 2012-08-22 16:12     ` H Hartley Sweeten
  0 siblings, 0 replies; 62+ messages in thread
From: H Hartley Sweeten @ 2012-08-22 16:12 UTC (permalink / raw)
  To: Julia Lawall, Grant Likely
  Cc: spi-devel-general, kernel-janitors, linux-kernel

On Sunday, August 19, 2012 1:44 AM, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Initialize return variable before exiting on an error path.

<snip>

> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
>  drivers/spi/spi-ep93xx.c |    1 +
>  1 file changed, 1 insertion(+)
>
> 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);

Looks ok to me... Thanks!

Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>

^ permalink raw reply	[flat|nested] 62+ messages in thread

* RE: [PATCH 10/14] drivers/spi/spi-ep93xx.c: fix error return code
@ 2012-08-22 16:12     ` H Hartley Sweeten
  0 siblings, 0 replies; 62+ messages in thread
From: H Hartley Sweeten @ 2012-08-22 16:12 UTC (permalink / raw)
  To: Julia Lawall, Grant Likely
  Cc: spi-devel-general, kernel-janitors, linux-kernel

On Sunday, August 19, 2012 1:44 AM, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Initialize return variable before exiting on an error path.

<snip>

> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
>  drivers/spi/spi-ep93xx.c |    1 +
>  1 file changed, 1 insertion(+)
>
> 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);

Looks ok to me... Thanks!

Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code
  2012-08-22 11:42         ` Julia Lawall
  (?)
@ 2012-08-22 17:00           ` Mark Brown
  -1 siblings, 0 replies; 62+ messages in thread
From: Mark Brown @ 2012-08-22 17:00 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Kukjin Kim, 'Ben Dooks',
	kernel-janitors, 'Grant Likely',
	linux-arm-kernel, linux-samsung-soc, spi-devel-general,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 195 bytes --]

On Wed, Aug 22, 2012 at 01:42:47PM +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Initialize return variable before exiting on an error path.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code
@ 2012-08-22 17:00           ` Mark Brown
  0 siblings, 0 replies; 62+ messages in thread
From: Mark Brown @ 2012-08-22 17:00 UTC (permalink / raw)
  To: linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 195 bytes --]

On Wed, Aug 22, 2012 at 01:42:47PM +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Initialize return variable before exiting on an error path.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 62+ messages in thread

* [PATCH 14/14] drivers/spi/spi-s3c24xx.c: fix error return code
@ 2012-08-22 17:00           ` Mark Brown
  0 siblings, 0 replies; 62+ messages in thread
From: Mark Brown @ 2012-08-22 17:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Aug 22, 2012 at 01:42:47PM +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Initialize return variable before exiting on an error path.

Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120822/a09091e8/attachment.sig>

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/14] drivers/power/ab8500_btemp.c: fix error return code
  2012-08-19  8:44   ` Julia Lawall
@ 2012-08-23  1:51     ` Anton Vorontsov
  -1 siblings, 0 replies; 62+ messages in thread
From: Anton Vorontsov @ 2012-08-23  1:51 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, David Woodhouse, linux-kernel

On Sun, Aug 19, 2012 at 10:44:22AM +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
[...]
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

2,3,4,5,6 applied, thanks!

> ---
>  drivers/power/ab8500_btemp.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/power/ab8500_btemp.c b/drivers/power/ab8500_btemp.c
> index bba3cca..2b76943 100644
> --- a/drivers/power/ab8500_btemp.c
> +++ b/drivers/power/ab8500_btemp.c
> @@ -1014,6 +1014,7 @@ static int __devinit ab8500_btemp_probe(struct platform_device *pdev)
>  		create_singlethread_workqueue("ab8500_btemp_wq");
>  	if (di->btemp_wq == NULL) {
>  		dev_err(di->dev, "failed to create work queue\n");
> +		ret = -ENOMEM;
>  		goto free_device_info;
>  	}
>  

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/14] drivers/power/ab8500_btemp.c: fix error return code
@ 2012-08-23  1:51     ` Anton Vorontsov
  0 siblings, 0 replies; 62+ messages in thread
From: Anton Vorontsov @ 2012-08-23  1:51 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, David Woodhouse, linux-kernel

On Sun, Aug 19, 2012 at 10:44:22AM +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
[...]
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

2,3,4,5,6 applied, thanks!

> ---
>  drivers/power/ab8500_btemp.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/power/ab8500_btemp.c b/drivers/power/ab8500_btemp.c
> index bba3cca..2b76943 100644
> --- a/drivers/power/ab8500_btemp.c
> +++ b/drivers/power/ab8500_btemp.c
> @@ -1014,6 +1014,7 @@ static int __devinit ab8500_btemp_probe(struct platform_device *pdev)
>  		create_singlethread_workqueue("ab8500_btemp_wq");
>  	if (di->btemp_wq = NULL) {
>  		dev_err(di->dev, "failed to create work queue\n");
> +		ret = -ENOMEM;
>  		goto free_device_info;
>  	}
>  

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 8/14] drivers/video/sunxvr2500.c: fix error return code
  2012-08-19  8:44   ` Julia Lawall
  (?)
@ 2012-08-23 20:48   ` Florian Tobias Schandinat
  -1 siblings, 0 replies; 62+ messages in thread
From: Florian Tobias Schandinat @ 2012-08-23 20:48 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, linux-fbdev, linux-kernel

On 08/19/2012 08:44 AM, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> 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>

Applied.


Thanks,

Florian Tobias Schandinat

> 
> ---
>  drivers/video/sunxvr2500.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/video/sunxvr2500.c b/drivers/video/sunxvr2500.c
> index 5848436..7fbcba8 100644
> --- a/drivers/video/sunxvr2500.c
> +++ b/drivers/video/sunxvr2500.c
> @@ -181,8 +181,10 @@ static int __devinit s3d_pci_register(struct pci_dev *pdev,
>  	sp->fb_size = info->fix.line_length * sp->height;
>  
>  	sp->fb_base = ioremap(sp->fb_base_phys, sp->fb_size);
> -	if (!sp->fb_base)
> +	if (!sp->fb_base) {
> +		err = -ENOMEM;
>  		goto err_release_pci;
> +	}
>  
>  	err = s3d_set_fbinfo(sp);
>  	if (err)
> 
> 


^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 7/14] drivers/mtd/maps/rbtx4939-flash.c: delete unneeded test
  2012-08-19  8:44   ` Julia Lawall
  (?)
@ 2012-08-25 11:04     ` Artem Bityutskiy
  -1 siblings, 0 replies; 62+ messages in thread
From: Artem Bityutskiy @ 2012-08-25 11:04 UTC (permalink / raw)
  To: Julia Lawall; +Cc: David Woodhouse, kernel-janitors, linux-mtd, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 398 bytes --]

On Sun, 2012-08-19 at 10:44 +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Err has only been initialized to 0 at this, so it is not possible that this
> test can be true.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)

Pushed to l2-mt.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 7/14] drivers/mtd/maps/rbtx4939-flash.c: delete unneeded test
@ 2012-08-25 11:04     ` Artem Bityutskiy
  0 siblings, 0 replies; 62+ messages in thread
From: Artem Bityutskiy @ 2012-08-25 11:04 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, David Woodhouse, linux-kernel, linux-mtd

[-- Attachment #1: Type: text/plain, Size: 398 bytes --]

On Sun, 2012-08-19 at 10:44 +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Err has only been initialized to 0 at this, so it is not possible that this
> test can be true.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)

Pushed to l2-mt.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 7/14] drivers/mtd/maps/rbtx4939-flash.c: delete unneeded test
@ 2012-08-25 11:04     ` Artem Bityutskiy
  0 siblings, 0 replies; 62+ messages in thread
From: Artem Bityutskiy @ 2012-08-25 11:04 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, David Woodhouse, linux-kernel, linux-mtd

[-- Attachment #1: Type: text/plain, Size: 398 bytes --]

On Sun, 2012-08-19 at 10:44 +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Err has only been initialized to 0 at this, so it is not possible that this
> test can be true.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)

Pushed to l2-mt.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 13/14] drivers/mtd/ubi/build.c: fix error return code
  2012-08-19  8:44   ` Julia Lawall
  (?)
@ 2012-08-25 11:10     ` Artem Bityutskiy
  -1 siblings, 0 replies; 62+ messages in thread
From: Artem Bityutskiy @ 2012-08-25 11:10 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, David Woodhouse, linux-mtd, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 244 bytes --]

On Sun, 2012-08-19 at 10:44 +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Initialize return variable before exiting on an error path.

Pushed to linux-ubi.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 13/14] drivers/mtd/ubi/build.c: fix error return code
@ 2012-08-25 11:10     ` Artem Bityutskiy
  0 siblings, 0 replies; 62+ messages in thread
From: Artem Bityutskiy @ 2012-08-25 11:10 UTC (permalink / raw)
  To: Julia Lawall; +Cc: David Woodhouse, kernel-janitors, linux-kernel, linux-mtd

[-- Attachment #1: Type: text/plain, Size: 244 bytes --]

On Sun, 2012-08-19 at 10:44 +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Initialize return variable before exiting on an error path.

Pushed to linux-ubi.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 13/14] drivers/mtd/ubi/build.c: fix error return code
@ 2012-08-25 11:10     ` Artem Bityutskiy
  0 siblings, 0 replies; 62+ messages in thread
From: Artem Bityutskiy @ 2012-08-25 11:10 UTC (permalink / raw)
  To: Julia Lawall; +Cc: David Woodhouse, kernel-janitors, linux-kernel, linux-mtd

[-- Attachment #1: Type: text/plain, Size: 244 bytes --]

On Sun, 2012-08-19 at 10:44 +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Initialize return variable before exiting on an error path.

Pushed to linux-ubi.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 62+ messages in thread

end of thread, other threads:[~2012-08-25 11:10 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-19  8:44 [PATCH 0/14] fix error return code Julia Lawall
2012-08-19  8:44 ` Julia Lawall
2012-08-19  8:44 ` [PATCH 1/14] drivers/rpmsg/virtio_rpmsg_bus.c: " Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-19  8:44 ` [PATCH 6/14] drivers/power/wm97xx_battery.c: " Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-19  8:44 ` [PATCH 5/14] drivers/power/ab8500_charger.c: " Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-19  8:44 ` [PATCH 4/14] drivers/power/bq27x00_battery.c: " Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-19  8:44 ` [PATCH 3/14] drivers/power/ab8500_fg.c: " Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-19  8:44 ` [PATCH 2/14] drivers/power/ab8500_btemp.c: " Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-23  1:51   ` Anton Vorontsov
2012-08-23  1:51     ` Anton Vorontsov
2012-08-19  8:44 ` [PATCH 7/14] drivers/mtd/maps/rbtx4939-flash.c: delete unneeded test Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-25 11:04   ` Artem Bityutskiy
2012-08-25 11:04     ` Artem Bityutskiy
2012-08-25 11:04     ` Artem Bityutskiy
2012-08-19  8:44 ` [PATCH 8/14] drivers/video/sunxvr2500.c: fix error return code Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-23 20:48   ` Florian Tobias Schandinat
2012-08-19  8:44 ` [PATCH 12/14] drivers/spi/spi-coldfire-qspi.c: " Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-19  8:44 ` [PATCH 11/14] drivers/spi/spi-orion.c: " Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-19  8:44 ` [PATCH 10/14] drivers/spi/spi-ep93xx.c: " Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-22 16:12   ` H Hartley Sweeten
2012-08-22 16:12     ` H Hartley Sweeten
2012-08-22 16:12     ` H Hartley Sweeten
2012-08-19  8:44 ` [PATCH 9/14] drivers/spi/spi-omap-100k.c: " Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-19  8:44 ` [PATCH 13/14] drivers/mtd/ubi/build.c: " Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-25 11:10   ` Artem Bityutskiy
2012-08-25 11:10     ` Artem Bityutskiy
2012-08-25 11:10     ` Artem Bityutskiy
2012-08-19  8:44 ` [PATCH 14/14] drivers/spi/spi-s3c24xx.c: " Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-19  8:44   ` Julia Lawall
2012-08-22  9:38   ` Kukjin Kim
2012-08-22  9:38     ` Kukjin Kim
2012-08-22  9:38     ` Kukjin Kim
2012-08-22 11:40     ` Mark Brown
2012-08-22 11:40       ` Mark Brown
2012-08-22 11:40       ` Mark Brown
2012-08-22 11:42       ` Julia Lawall
2012-08-22 11:42         ` Julia Lawall
2012-08-22 11:42         ` Julia Lawall
2012-08-22 17:00         ` Mark Brown
2012-08-22 17:00           ` Mark Brown
2012-08-22 17:00           ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.