All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 23/25] thermal: exynos: fix error return code
  2013-12-29 22:47 ` Julia Lawall
  (?)
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:52 UTC (permalink / raw)
  To: linux-arm-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/thermal/samsung/exynos_tmu.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 32f38b9..0d96a51 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -205,6 +205,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
 skip_calib_data:
 	if (pdata->max_trigger_level > MAX_THRESHOLD_LEVS) {
 		dev_err(&pdev->dev, "Invalid max trigger level\n");
+		ret = -EINVAL;
 		goto out;
 	}
 


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

* [PATCH 21/25] fujitsu-laptop: fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:53 UTC (permalink / raw)
  To: Jonathan Woithe
  Cc: kernel-janitors, Matthew Garrett, platform-driver-x86, linux-kernel

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

These functions mix the use of result and error.  In acpi_fujitsu_add,
result does not seem useful; it would seem reasonable to propagate the
return value of acpi_bus_update_power in an error case.  On the other hand,
in the case of acpi_fujitsu_hotkey_add, there is an initialization of
result that can lead to what looks like a failure case, but that does not
abort the function.  The variable result is kept for this case.

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>

---
Not tested.  Not sure to be doing the right thing with result in the second
case.

 drivers/platform/x86/fujitsu-laptop.c |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index 9d30d69..be02bcc 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -633,7 +633,6 @@ static struct dmi_system_id fujitsu_dmi_table[] = {
 
 static int acpi_fujitsu_add(struct acpi_device *device)
 {
-	int result = 0;
 	int state = 0;
 	struct input_dev *input;
 	int error;
@@ -669,8 +668,8 @@ static int acpi_fujitsu_add(struct acpi_device *device)
 	if (error)
 		goto err_free_input_dev;
 
-	result = acpi_bus_update_power(fujitsu->acpi_handle, &state);
-	if (result) {
+	error = acpi_bus_update_power(fujitsu->acpi_handle, &state);
+	if (error) {
 		pr_err("Error reading power state\n");
 		goto err_unregister_input_dev;
 	}
@@ -700,7 +699,7 @@ static int acpi_fujitsu_add(struct acpi_device *device)
 		fujitsu->max_brightness = FUJITSU_LCD_N_LEVELS;
 	get_lcd_level();
 
-	return result;
+	return 0;
 
 err_unregister_input_dev:
 	input_unregister_device(input);
@@ -708,7 +707,7 @@ err_unregister_input_dev:
 err_free_input_dev:
 	input_free_device(input);
 err_stop:
-	return result;
+	return error;
 }
 
 static int acpi_fujitsu_remove(struct acpi_device *device)
@@ -831,8 +830,8 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
 	if (error)
 		goto err_free_input_dev;
 
-	result = acpi_bus_update_power(fujitsu_hotkey->acpi_handle, &state);
-	if (result) {
+	error = acpi_bus_update_power(fujitsu_hotkey->acpi_handle, &state);
+	if (error) {
 		pr_err("Error reading power state\n");
 		goto err_unregister_input_dev;
 	}
@@ -907,7 +906,7 @@ err_free_input_dev:
 err_free_fifo:
 	kfifo_free(&fujitsu_hotkey->fifo);
 err_stop:
-	return result;
+	return error;
 }
 
 static int acpi_fujitsu_hotkey_remove(struct acpi_device *device)


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

* [PATCH 20/25]  fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:53 UTC (permalink / raw)
  To: Antti Palosaari
  Cc: kernel-janitors, Mauro Carvalho Chehab, linux-media, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/media/tuners/e4000.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/media/tuners/e4000.c b/drivers/media/tuners/e4000.c
index 72971a8..40c1da7 100644
--- a/drivers/media/tuners/e4000.c
+++ b/drivers/media/tuners/e4000.c
@@ -243,8 +243,10 @@ static int e4000_set_params(struct dvb_frontend *fe)
 			break;
 	}
 
-	if (i = ARRAY_SIZE(e4000_pll_lut))
+	if (i = ARRAY_SIZE(e4000_pll_lut)) {
+		ret = -EINVAL;
 		goto err;
+	}
 
 	/*
 	 * Note: Currently f_vco overflows when c->frequency is 1 073 741 824 Hz
@@ -271,8 +273,10 @@ static int e4000_set_params(struct dvb_frontend *fe)
 			break;
 	}
 
-	if (i = ARRAY_SIZE(e400_lna_filter_lut))
+	if (i = ARRAY_SIZE(e400_lna_filter_lut)) {
+		ret = -EINVAL;
 		goto err;
+	}
 
 	ret = e4000_wr_reg(priv, 0x10, e400_lna_filter_lut[i].val);
 	if (ret < 0)
@@ -284,8 +288,10 @@ static int e4000_set_params(struct dvb_frontend *fe)
 			break;
 	}
 
-	if (i = ARRAY_SIZE(e4000_if_filter_lut))
+	if (i = ARRAY_SIZE(e4000_if_filter_lut)) {
+		ret = -EINVAL;
 		goto err;
+	}
 
 	buf[0] = e4000_if_filter_lut[i].reg11_val;
 	buf[1] = e4000_if_filter_lut[i].reg12_val;
@@ -300,8 +306,10 @@ static int e4000_set_params(struct dvb_frontend *fe)
 			break;
 	}
 
-	if (i = ARRAY_SIZE(e4000_band_lut))
+	if (i = ARRAY_SIZE(e4000_band_lut)) {
+		ret = -EINVAL;
 		goto err;
+	}
 
 	ret = e4000_wr_reg(priv, 0x07, e4000_band_lut[i].reg07_val);
 	if (ret < 0)


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

* [PATCH 15/25]  fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/block/umem.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/block/umem.c b/drivers/block/umem.c
index 4cf81b5..371e819 100644
--- a/drivers/block/umem.c
+++ b/drivers/block/umem.c
@@ -881,6 +881,7 @@ static int mm_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	if (card->mm_pages[0].desc = NULL ||
 	    card->mm_pages[1].desc = NULL) {
 		dev_printk(KERN_ERR, &card->dev->dev, "alloc failed\n");
+		ret = -ENOMEM;
 		goto failed_alloc;
 	}
 	reset_page(&card->mm_pages[0]);
@@ -891,8 +892,10 @@ static int mm_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	card->biotail = &card->bio;
 
 	card->queue = blk_alloc_queue(GFP_KERNEL);
-	if (!card->queue)
+	if (!card->queue) {
+		ret = -ENOMEM;
 		goto failed_alloc;
+	}
 
 	blk_queue_make_request(card->queue, mm_make_request);
 	card->queue->queue_lock = &card->lock;


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

* [PATCH 13/25] hamradio: 6pack: fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:54 UTC (permalink / raw)
  To: ajk, linux-hams, netdev; +Cc: kernel-janitors, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/net/hamradio/6pack.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
index 1450e33..66e2b19 100644
--- a/drivers/net/hamradio/6pack.c
+++ b/drivers/net/hamradio/6pack.c
@@ -662,7 +662,8 @@ static int sixpack_open(struct tty_struct *tty)
 	tty->receive_room = 65536;
 
 	/* Now we're ready to register. */
-	if (register_netdev(dev))
+	err = register_netdev(dev);
+	if (err)
 		goto out_free;
 
 	tnc_init(sp);

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

* [PATCH 24/25]  fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:54 UTC (permalink / raw)
  To: Eddie Wai; +Cc: kernel-janitors, James E.J. Bottomley, linux-scsi, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/scsi/bnx2fc/bnx2fc_fcoe.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 9b94850..d8cb194 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -2199,6 +2199,7 @@ static int _bnx2fc_create(struct net_device *netdev,
 	interface = bnx2fc_interface_create(hba, netdev, fip_mode);
 	if (!interface) {
 		printk(KERN_ERR PFX "bnx2fc_interface_create failed\n");
+		rc = -ENOMEM;
 		goto ifput_err;
 	}
 


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

* [PATCH 22/25] RDMA/nes: fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:54 UTC (permalink / raw)
  To: Faisal Latif
  Cc: kernel-janitors, Roland Dreier, Sean Hefty, Hal Rosenstock,
	linux-rdma, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/infiniband/hw/nes/nes.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c
index 4291410..353c7b0 100644
--- a/drivers/infiniband/hw/nes/nes.c
+++ b/drivers/infiniband/hw/nes/nes.c
@@ -675,8 +675,11 @@ static int nes_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
 	INIT_DELAYED_WORK(&nesdev->work, nes_recheck_link_status);
 
 	/* Initialize network devices */
-	if ((netdev = nes_netdev_init(nesdev, mmio_regs)) = NULL)
+	netdev = nes_netdev_init(nesdev, mmio_regs);
+	if (netdev = NULL) {
+		ret = -ENOMEM;
 		goto bail7;
+	}
 
 	/* Register network device */
 	ret = register_netdev(netdev);


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

* [PATCH 14/25] RDMA/amso1100: fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:54 UTC (permalink / raw)
  To: Tom Tucker
  Cc: kernel-janitors, Steve Wise, Roland Dreier, Sean Hefty,
	Hal Rosenstock, linux-rdma, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/infiniband/hw/amso1100/c2.c      |    4 +++-
 drivers/infiniband/hw/amso1100/c2_rnic.c |    3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/amso1100/c2.c b/drivers/infiniband/hw/amso1100/c2.c
index d53cf51..00400c3 100644
--- a/drivers/infiniband/hw/amso1100/c2.c
+++ b/drivers/infiniband/hw/amso1100/c2.c
@@ -1082,6 +1082,7 @@ static int c2_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
 
 	/* Initialize network device */
 	if ((netdev = c2_devinit(c2dev, mmio_regs)) = NULL) {
+		ret = -ENOMEM;
 		iounmap(mmio_regs);
 		goto bail4;
 	}
@@ -1151,7 +1152,8 @@ static int c2_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
 		goto bail10;
 	}
 
-	if (c2_register_device(c2dev))
+	ret = c2_register_device(c2dev);
+	if (ret)
 		goto bail10;
 
 	return 0;
diff --git a/drivers/infiniband/hw/amso1100/c2_rnic.c b/drivers/infiniband/hw/amso1100/c2_rnic.c
index b7c9869..d2a6d96 100644
--- a/drivers/infiniband/hw/amso1100/c2_rnic.c
+++ b/drivers/infiniband/hw/amso1100/c2_rnic.c
@@ -576,7 +576,8 @@ int c2_rnic_init(struct c2_dev *c2dev)
 		goto bail4;
 
 	/* Initialize cached the adapter limits */
-	if (c2_rnic_query(c2dev, &c2dev->props))
+	err = c2_rnic_query(c2dev, &c2dev->props);
+	if (err)
 		goto bail5;
 
 	/* Initialize the PD pool */


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

* [PATCH 9/25]  fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:54 UTC (permalink / raw)
  To: Hiral Patel
  Cc: kernel-janitors, Suma Ramars, Brian Uchino, James E.J. Bottomley,
	linux-scsi, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/scsi/fnic/fnic_main.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c
index 33e4ec2..a3472a1 100644
--- a/drivers/scsi/fnic/fnic_main.c
+++ b/drivers/scsi/fnic/fnic_main.c
@@ -731,17 +731,23 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		spin_lock_init(&fnic->io_req_lock[i]);
 
 	fnic->io_req_pool = mempool_create_slab_pool(2, fnic_io_req_cache);
-	if (!fnic->io_req_pool)
+	if (!fnic->io_req_pool) {
+		err = -ENOMEM;
 		goto err_out_free_resources;
+	}
 
 	pool = mempool_create_slab_pool(2, fnic_sgl_cache[FNIC_SGL_CACHE_DFLT]);
-	if (!pool)
+	if (!pool) {
+		err = -ENOMEM;
 		goto err_out_free_ioreq_pool;
+	}
 	fnic->io_sgl_pool[FNIC_SGL_CACHE_DFLT] = pool;
 
 	pool = mempool_create_slab_pool(2, fnic_sgl_cache[FNIC_SGL_CACHE_MAX]);
-	if (!pool)
+	if (!pool) {
+		err = -ENOMEM;
 		goto err_out_free_dflt_pool;
+	}
 	fnic->io_sgl_pool[FNIC_SGL_CACHE_MAX] = pool;
 
 	/* setup vlan config, hw inserts vlan header */


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

* [PATCH 19/25]  fix error return code
  2013-12-29 22:47 ` Julia Lawall
  (?)
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:55 UTC (permalink / raw)
  To: Geoff Levand
  Cc: kernel-janitors, James E.J. Bottomley, linuxppc-dev, cbe-oss-dev,
	linux-scsi, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/scsi/ps3rom.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c
index e6e2a30..04d77ce 100644
--- a/drivers/scsi/ps3rom.c
+++ b/drivers/scsi/ps3rom.c
@@ -387,6 +387,7 @@ static int ps3rom_probe(struct ps3_system_bus_device *_dev)
 	if (!host) {
 		dev_err(&dev->sbd.core, "%s:%u: scsi_host_alloc failed\n",
 			__func__, __LINE__);
+		error = -ENOMEM;
 		goto fail_teardown;
 	}
 


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

* [PATCH 11/25] pcmcia: fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:55 UTC (permalink / raw)
  To: linux-pcmcia; +Cc: kernel-janitors, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/pcmcia/electra_cf.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/pcmcia/electra_cf.c b/drivers/pcmcia/electra_cf.c
index 5ea64d0..b012bd9 100644
--- a/drivers/pcmcia/electra_cf.c
+++ b/drivers/pcmcia/electra_cf.c
@@ -251,23 +251,31 @@ static int electra_cf_probe(struct platform_device *ofdev)
 	cf->socket.pci_irq = cf->irq;
 
 	prop = of_get_property(np, "card-detect-gpio", NULL);
-	if (!prop)
+	if (!prop) {
+		status = -ENODEV;
 		goto fail1;
+	}
 	cf->gpio_detect = *prop;
 
 	prop = of_get_property(np, "card-vsense-gpio", NULL);
-	if (!prop)
+	if (!prop) {
+		status = -ENODEV;
 		goto fail1;
+	}
 	cf->gpio_vsense = *prop;
 
 	prop = of_get_property(np, "card-3v-gpio", NULL);
-	if (!prop)
+	if (!prop) {
+		status = -ENODEV;
 		goto fail1;
+	}
 	cf->gpio_3v = *prop;
 
 	prop = of_get_property(np, "card-5v-gpio", NULL);
-	if (!prop)
+	if (!prop) {
+		status = -ENODEV;
 		goto fail1;
+	}
 	cf->gpio_5v = *prop;
 
 	cf->socket.io_offset = cf->io_base;


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

* [PATCH 12/25] HID: sony: fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:55 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: kernel-janitors, linux-input, linux-kernel

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

Currently the return variable ret is always 0.  Set it to other values in
error cases, as used in the direct return.

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>

---
Not tested.

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

diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index b60bc38..f57ab5e 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -585,6 +585,7 @@ static int sony_leds_init(struct hid_device *hdev)
 		led = kzalloc(sizeof(struct led_classdev) + name_sz, GFP_KERNEL);
 		if (!led) {
 			hid_err(hdev, "Couldn't allocate memory for LED %d\n", n);
+			ret = -ENOMEM;
 			goto error_leds;
 		}
 
@@ -596,7 +597,8 @@ static int sony_leds_init(struct hid_device *hdev)
 		led->brightness_get = sony_led_get_brightness;
 		led->brightness_set = sony_led_set_brightness;
 
-		if (led_classdev_register(&hdev->dev, led)) {
+		ret = led_classdev_register(&hdev->dev, led);
+		if (ret) {
 			hid_err(hdev, "Failed to register LED %d\n", n);
 			kfree(led);
 			goto error_leds;


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

* [PATCH 10/25] usb: gadget: fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:56 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: kernel-janitors, Greg Kroah-Hartman, linux-usb, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/usb/gadget/printer.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c
index bf7a56b..92b55bd 100644
--- a/drivers/usb/gadget/printer.c
+++ b/drivers/usb/gadget/printer.c
@@ -1133,6 +1133,7 @@ static int __init printer_bind_config(struct usb_configuration *c)
 				  NULL, "g_printer");
 	if (IS_ERR(dev->pdev)) {
 		ERROR(dev, "Failed to create device: g_printer\n");
+		status = PTR_ERR(dev->pdev);
 		goto fail;
 	}
 


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

* [PATCH 18/25] mtd: nand: fix error return code
  2013-12-29 22:47 ` Julia Lawall
  (?)
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:56 UTC (permalink / raw)
  To: David Woodhouse; +Cc: linux-mtd, Brian Norris, kernel-janitors, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/mtd/nand/fsmc_nand.c    |    3 +++
 drivers/mtd/tests/oobtest.c     |    1 +
 drivers/mtd/tests/pagetest.c    |    1 +
 drivers/mtd/tests/subpagetest.c |    1 +
 4 files changed, 6 insertions(+)

diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index 8b27522..6f8c4f5 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -1040,12 +1040,15 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
 				pdata->read_dma_priv);
 		if (!host->read_dma_chan) {
 			dev_err(&pdev->dev, "Unable to get read dma channel\n");
+			ret = -EBUSY;
 			goto err_req_read_chnl;
 		}
 		host->write_dma_chan = dma_request_channel(mask, filter,
 				pdata->write_dma_priv);
 		if (!host->write_dma_chan) {
 			dev_err(&pdev->dev, "Unable to get write dma channel\n");
+
+			ret = -EBUSY;
 			goto err_req_write_chnl;
 		}
 		nand->read_buf = fsmc_read_buf_dma;
diff --git a/drivers/mtd/tests/oobtest.c b/drivers/mtd/tests/oobtest.c
index 2e9e2d1..26688e9 100644
--- a/drivers/mtd/tests/oobtest.c
+++ b/drivers/mtd/tests/oobtest.c
@@ -291,6 +291,7 @@ static int __init mtd_oobtest_init(void)
 
 	if (!mtd_type_is_nand(mtd)) {
 		pr_info("this test requires NAND flash\n");
+		err = -ENODEV;
 		goto out;
 	}
 
diff --git a/drivers/mtd/tests/pagetest.c b/drivers/mtd/tests/pagetest.c
index ed2d3f6..9a84460 100644
--- a/drivers/mtd/tests/pagetest.c
+++ b/drivers/mtd/tests/pagetest.c
@@ -355,6 +355,7 @@ static int __init mtd_pagetest_init(void)
 
 	if (!mtd_type_is_nand(mtd)) {
 		pr_info("this test requires NAND flash\n");
+		err = -ENODEV;
 		goto out;
 	}
 
diff --git a/drivers/mtd/tests/subpagetest.c b/drivers/mtd/tests/subpagetest.c
index a876371..2baa93d 100644
--- a/drivers/mtd/tests/subpagetest.c
+++ b/drivers/mtd/tests/subpagetest.c
@@ -301,6 +301,7 @@ static int __init mtd_subpagetest_init(void)
 
 	if (!mtd_type_is_nand(mtd)) {
 		pr_info("this test requires NAND flash\n");
+		err = -ENODEV;
 		goto out;
 	}
 


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

* [PATCH 16/25] block: fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/cdrom/gdrom.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c
index 51e75ad..93d29b1 100644
--- a/drivers/cdrom/gdrom.c
+++ b/drivers/cdrom/gdrom.c
@@ -807,16 +807,20 @@ static int probe_gdrom(struct platform_device *devptr)
 	if (err)
 		goto probe_fail_cmdirq_register;
 	gd.gdrom_rq = blk_init_queue(gdrom_request, &gdrom_lock);
-	if (!gd.gdrom_rq)
+	if (!gd.gdrom_rq) {
+		err = -ENOMEM;
 		goto probe_fail_requestq;
+	}
 
 	err = probe_gdrom_setupqueue();
 	if (err)
 		goto probe_fail_toc;
 
 	gd.toc = kzalloc(sizeof(struct gdromtoc), GFP_KERNEL);
-	if (!gd.toc)
+	if (!gd.toc) {
+		err = -ENOMEM;
 		goto probe_fail_toc;
+	}
 	add_disk(gd.disk);
 	return 0;
 


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

* [PATCH 17/25]  fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:57 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/char/xilinx_hwicap/xilinx_hwicap.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
index f6345f9..9b1a5ac 100644
--- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c
+++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
@@ -661,6 +661,7 @@ static int hwicap_setup(struct device *dev, int id,
 	drvdata->base_address = ioremap(drvdata->mem_start, drvdata->mem_size);
 	if (!drvdata->base_address) {
 		dev_err(dev, "ioremap() failed\n");
+		retval = -ENOMEM;
 		goto failed2;
 	}
 


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

* [PATCH 6/25]  fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:57 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: kernel-janitors, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

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

diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 3dda09a..a2af73d 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -706,7 +706,9 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command *
 			     WRITE : READ, __GFP_WAIT);
 
 	if (cgc->buflen) {
-		if (blk_rq_map_kern(q, rq, cgc->buffer, cgc->buflen, __GFP_WAIT))
+		ret = blk_rq_map_kern(q, rq, cgc->buffer, cgc->buflen,
+				      __GFP_WAIT);
+		if (ret)
 			goto out;
 	}
 


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

* [PATCH 8/25] drivers/dma: fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:57 UTC (permalink / raw)
  To: Vinod Koul; +Cc: kernel-janitors, Dan Williams, dmaengine, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/dma/cppi41.c      |    4 +++-
 drivers/dma/ppc4xx/adma.c |    1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c
index c29dacf..c18aebf 100644
--- a/drivers/dma/cppi41.c
+++ b/drivers/dma/cppi41.c
@@ -972,8 +972,10 @@ static int cppi41_dma_probe(struct platform_device *pdev)
 		goto err_chans;
 
 	irq = irq_of_parse_and_map(dev->of_node, 0);
-	if (!irq)
+	if (!irq) {
+		ret = -EINVAL;
 		goto err_irq;
+	}
 
 	cppi_writel(USBSS_IRQ_PD_COMP, cdd->usbss_mem + USBSS_IRQ_ENABLER);
 
diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c
index 8bba298..ce7a8d7 100644
--- a/drivers/dma/ppc4xx/adma.c
+++ b/drivers/dma/ppc4xx/adma.c
@@ -4114,6 +4114,7 @@ static int ppc440spe_adma_probe(struct platform_device *ofdev)
 	regs = ioremap(res.start, resource_size(&res));
 	if (!regs) {
 		dev_err(&ofdev->dev, "failed to ioremap regs!\n");
+		ret = -ENOMEM;
 		goto err_regs_alloc;
 	}
 


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

* Re: [PATCH 19/25] fix error return code
  2013-12-29 22:47   ` Julia Lawall
  (?)
@ 2013-12-29 21:58     ` Geert Uytterhoeven
  -1 siblings, 0 replies; 88+ messages in thread
From: Geert Uytterhoeven @ 2013-12-29 21:58 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Geoff Levand, kernel-janitors, James E.J. Bottomley,
	linuxppc-dev, cbe-oss-dev, scsi, linux-kernel

On Sun, Dec 29, 2013 at 11:47 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Set the return variable to an error code as done elsewhere in the function.
>
> 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: Geert Uytterhoeven <geert@linux-m68k.org>

> ---
> Not tested.
>
>  drivers/scsi/ps3rom.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c
> index e6e2a30..04d77ce 100644
> --- a/drivers/scsi/ps3rom.c
> +++ b/drivers/scsi/ps3rom.c
> @@ -387,6 +387,7 @@ static int ps3rom_probe(struct ps3_system_bus_device *_dev)
>         if (!host) {
>                 dev_err(&dev->sbd.core, "%s:%u: scsi_host_alloc failed\n",
>                         __func__, __LINE__);
> +               error = -ENOMEM;
>                 goto fail_teardown;

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 19/25] fix error return code
@ 2013-12-29 21:58     ` Geert Uytterhoeven
  0 siblings, 0 replies; 88+ messages in thread
From: Geert Uytterhoeven @ 2013-12-29 21:58 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Geoff Levand, kernel-janitors, James E.J. Bottomley,
	linuxppc-dev, cbe-oss-dev, scsi, linux-kernel

On Sun, Dec 29, 2013 at 11:47 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Set the return variable to an error code as done elsewhere in the function.
>
> 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: Geert Uytterhoeven <geert@linux-m68k.org>

> ---
> Not tested.
>
>  drivers/scsi/ps3rom.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c
> index e6e2a30..04d77ce 100644
> --- a/drivers/scsi/ps3rom.c
> +++ b/drivers/scsi/ps3rom.c
> @@ -387,6 +387,7 @@ static int ps3rom_probe(struct ps3_system_bus_device *_dev)
>         if (!host) {
>                 dev_err(&dev->sbd.core, "%s:%u: scsi_host_alloc failed\n",
>                         __func__, __LINE__);
> +               error = -ENOMEM;
>                 goto fail_teardown;

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 19/25] fix error return code
@ 2013-12-29 21:58     ` Geert Uytterhoeven
  0 siblings, 0 replies; 88+ messages in thread
From: Geert Uytterhoeven @ 2013-12-29 21:58 UTC (permalink / raw)
  To: Julia Lawall
  Cc: cbe-oss-dev, scsi, Geoff Levand, kernel-janitors, linux-kernel,
	James E.J. Bottomley, linuxppc-dev

On Sun, Dec 29, 2013 at 11:47 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Set the return variable to an error code as done elsewhere in the function.
>
> 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: Geert Uytterhoeven <geert@linux-m68k.org>

> ---
> Not tested.
>
>  drivers/scsi/ps3rom.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c
> index e6e2a30..04d77ce 100644
> --- a/drivers/scsi/ps3rom.c
> +++ b/drivers/scsi/ps3rom.c
> @@ -387,6 +387,7 @@ static int ps3rom_probe(struct ps3_system_bus_device *_dev)
>         if (!host) {
>                 dev_err(&dev->sbd.core, "%s:%u: scsi_host_alloc failed\n",
>                         __func__, __LINE__);
> +               error = -ENOMEM;
>                 goto fail_teardown;

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* [PATCH 0/25] fix error return code
@ 2013-12-29 22:47 ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

These patches fix cases where the return variable is not set to an error
code in an error case.


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

* [PATCH 7/25] net: fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:59 UTC (permalink / raw)
  To: Geoff Levand; +Cc: kernel-janitors, netdev, cbe-oss-dev, linux-kernel

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

Set the return variable to propagate any error code as done elsewhere in
the function.

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>

---
Not tested.

 drivers/net/ethernet/toshiba/ps3_gelic_net.c |   18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.c b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
index f7f2ef4..d899d00 100644
--- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c
+++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
@@ -1739,12 +1739,14 @@ static int ps3_gelic_driver_probe(struct ps3_system_bus_device *dev)
 		GELIC_CARD_PORT_STATUS_CHANGED;
 
 
-	if (gelic_card_init_chain(card, &card->tx_chain,
-			card->descr, GELIC_NET_TX_DESCRIPTORS))
+	result = gelic_card_init_chain(card, &card->tx_chain,
+				       card->descr, GELIC_NET_TX_DESCRIPTORS);
+	if (result)
 		goto fail_alloc_tx;
-	if (gelic_card_init_chain(card, &card->rx_chain,
-				 card->descr + GELIC_NET_TX_DESCRIPTORS,
-				 GELIC_NET_RX_DESCRIPTORS))
+	result = gelic_card_init_chain(card, &card->rx_chain,
+				       card->descr + GELIC_NET_TX_DESCRIPTORS,
+				       GELIC_NET_RX_DESCRIPTORS);
+	if (result)
 		goto fail_alloc_rx;
 
 	/* head of chain */
@@ -1754,7 +1756,8 @@ static int ps3_gelic_driver_probe(struct ps3_system_bus_device *dev)
 		card->rx_top, card->tx_top, sizeof(struct gelic_descr),
 		GELIC_NET_RX_DESCRIPTORS);
 	/* allocate rx skbs */
-	if (gelic_card_alloc_rx_skbs(card))
+	result = gelic_card_alloc_rx_skbs(card);
+	if (result)
 		goto fail_alloc_skbs;
 
 	spin_lock_init(&card->tx_lock);
@@ -1772,7 +1775,8 @@ static int ps3_gelic_driver_probe(struct ps3_system_bus_device *dev)
 	}
 
 #ifdef CONFIG_GELIC_WIRELESS
-	if (gelic_wl_driver_probe(card)) {
+	result = gelic_wl_driver_probe(card);
+	if (result) {
 		dev_dbg(&dev->core, "%s: WL init failed\n", __func__);
 		goto fail_setup_netdev;
 	}


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

* [PATCH 5/25] IB/mlx4: fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:59 UTC (permalink / raw)
  To: Roland Dreier
  Cc: kernel-janitors, Sean Hefty, Hal Rosenstock, linux-rdma, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/infiniband/hw/mlx4/sysfs.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/sysfs.c b/drivers/infiniband/hw/mlx4/sysfs.c
index 97516eb..db2ea31 100644
--- a/drivers/infiniband/hw/mlx4/sysfs.c
+++ b/drivers/infiniband/hw/mlx4/sysfs.c
@@ -582,8 +582,10 @@ static int add_port(struct mlx4_ib_dev *dev, int port_num, int slave)
 	p->pkey_group.attrs  		alloc_group_attrs(show_port_pkey, store_port_pkey,
 				  dev->dev->caps.pkey_table_len[port_num]);
-	if (!p->pkey_group.attrs)
+	if (!p->pkey_group.attrs) {
+		ret = -ENOMEM;
 		goto err_alloc;
+	}
 
 	ret = sysfs_create_group(&p->kobj, &p->pkey_group);
 	if (ret)
@@ -591,8 +593,10 @@ static int add_port(struct mlx4_ib_dev *dev, int port_num, int slave)
 
 	p->gid_group.name  = "gid_idx";
 	p->gid_group.attrs = alloc_group_attrs(show_port_gid_idx, NULL, 1);
-	if (!p->gid_group.attrs)
+	if (!p->gid_group.attrs) {
+		ret = -ENOMEM;
 		goto err_free_pkey;
+	}
 
 	ret = sysfs_create_group(&p->kobj, &p->gid_group);
 	if (ret)


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

* [PATCH 3/25]  fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:59 UTC (permalink / raw)
  To: Antti Palosaari
  Cc: kernel-janitors, Mauro Carvalho Chehab, linux-media, linux-kernel

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

The rest of the function uses ret to store the return value, even setting
ret to i a few lines before this, so return ret instead of i.

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>

---
Not tested.

 drivers/media/usb/dvb-usb-v2/ec168.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/dvb-usb-v2/ec168.c b/drivers/media/usb/dvb-usb-v2/ec168.c
index 5c68f39..0c2b377 100644
--- a/drivers/media/usb/dvb-usb-v2/ec168.c
+++ b/drivers/media/usb/dvb-usb-v2/ec168.c
@@ -170,7 +170,7 @@ static int ec168_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
 
 error:
 	mutex_unlock(&d->i2c_mutex);
-	return i;
+	return ret;
 }
 
 static u32 ec168_i2c_func(struct i2c_adapter *adapter)


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

* [PATCH 4/25] UBI: fix error return code
  2013-12-29 22:47 ` Julia Lawall
  (?)
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 21:59 UTC (permalink / raw)
  To: Artem Bityutskiy
  Cc: David Woodhouse, Brian Norris, kernel-janitors, linux-kernel, linux-mtd

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/mtd/ubi/attach.c |    4 +++-
 drivers/mtd/ubi/build.c  |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index 33bb1f2..6f27d9a 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -1453,8 +1453,10 @@ int ubi_attach(struct ubi_device *ubi, int force_scan)
 		struct ubi_attach_info *scan_ai;
 
 		scan_ai = alloc_ai("ubi_ckh_aeb_slab_cache");
-		if (!scan_ai)
+		if (!scan_ai) {
+			err = -ENOMEM;
 			goto out_wl;
+		}
 
 		err = scan_all(ubi, scan_ai, 0);
 		if (err) {
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index e05dc62..57deae9 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -1245,8 +1245,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] 88+ messages in thread

* [PATCH 2/25] rsxx: fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:00 UTC (permalink / raw)
  To: Joshua Morris; +Cc: kernel-janitors, Philip Kelleher, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/block/rsxx/core.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/block/rsxx/core.c b/drivers/block/rsxx/core.c
index a8de2ee..fa8077a 100644
--- a/drivers/block/rsxx/core.c
+++ b/drivers/block/rsxx/core.c
@@ -942,6 +942,7 @@ static int rsxx_pci_probe(struct pci_dev *dev,
 	card->event_wq = create_singlethread_workqueue(DRIVER_NAME"_event");
 	if (!card->event_wq) {
 		dev_err(CARD_TO_DEV(card), "Failed card event setup.\n");
+		st = -ENOMEM;
 		goto failed_event_handler;
 	}
 


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

* [PATCH 1/25]  fix error return code
  2013-12-29 22:47 ` Julia Lawall
@ 2013-12-29 22:47   ` Julia Lawall
  -1 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:00 UTC (permalink / raw)
  To: Jayamohan Kallickal
  Cc: kernel-janitors, James E.J. Bottomley, linux-scsi, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

Additionally, in each case there is no need to initialize ret to 0, since
its value is immediately overwritten.

A simplified version of the semantic match that finds the first 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>

---
Not tested.

 drivers/scsi/be2iscsi/be_main.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 1f37505..82f4587 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -4326,7 +4326,7 @@ static int beiscsi_get_boot_info(struct beiscsi_hba *phba)
 	struct be_dma_mem nonemb_cmd;
 	unsigned int tag;
 	unsigned int s_handle;
-	int ret = -ENOMEM;
+	int ret;
 
 	/* Get the session handle of the boot target */
 	ret = be_mgmt_get_boot_shandle(phba, &s_handle);
@@ -4356,6 +4356,7 @@ static int beiscsi_get_boot_info(struct beiscsi_hba *phba)
 			    BEISCSI_LOG_INIT | BEISCSI_LOG_CONFIG,
 			    "BM_%d : beiscsi_get_session_info"
 			    " Failed\n");
+		ret = -ENOMEM;
 
 		goto boot_freemem;
 	}
@@ -4455,7 +4456,8 @@ static int beiscsi_init_port(struct beiscsi_hba *phba)
 		goto do_cleanup_ctrlr;
 	}
 
-	if (hba_setup_cid_tbls(phba)) {
+	ret = hba_setup_cid_tbls(phba);
+	if (ret < 0) {
 		beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
 			    "BM_%d : Failed in hba_setup_cid_tbls\n");
 		kfree(phba->io_sgl_hndl_base);
@@ -5479,7 +5481,7 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
 	struct hwi_controller *phwi_ctrlr;
 	struct hwi_context_memory *phwi_context;
 	struct be_eq_obj *pbe_eq;
-	int ret = 0, i;
+	int ret, i;
 
 	ret = beiscsi_enable_pci(pcidev);
 	if (ret < 0) {
@@ -5492,6 +5494,7 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
 	if (!phba) {
 		dev_err(&pcidev->dev,
 			"beiscsi_dev_probe - Failed in beiscsi_hba_alloc\n");
+		ret = -ENOMEM;
 		goto disable_pci;
 	}
 
@@ -5586,6 +5589,7 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
 		beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
 			    "BM_%d : beiscsi_dev_probe-"
 			    "Failed in beiscsi_init_port\n");
+		ret = -ENOMEM;
 		goto free_port;
 	}
 


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

* [PATCH 0/25] fix error return code
@ 2013-12-29 22:47 ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: linux-input-u79uwXL29TY76Z2rM5mHXA
  Cc: cbe-oss-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/,
	linux-pcmcia-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA,
	linux-pm-u79uwXL29TY76Z2rM5mHXA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	platform-driver-x86-u79uwXL29TY76Z2rM5mHXA,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	dmaengine-u79uwXL29TY76Z2rM5mHXA,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-media-u79uwXL29TY76Z2rM5mHXA

These patches fix cases where the return variable is not set to an error
code in an error case.

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

* [PATCH 0/25] fix error return code
@ 2013-12-29 22:47 ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: linux-input
  Cc: kernel-janitors, linux-usb, dmaengine, linux-mtd, linux-kernel,
	linux-scsi, linux-media, linux-rdma, netdev, cbe-oss-dev,
	linux-pcmcia, rtc-linux, linuxppc-dev, platform-driver-x86,
	linux-pm, linux-arm-kernel, linux-samsung-soc,
	davinci-linux-open-source

These patches fix cases where the return variable is not set to an error
code in an error case.


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

* [PATCH 0/25] fix error return code
@ 2013-12-29 22:47 ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: linux-input-u79uwXL29TY76Z2rM5mHXA
  Cc: cbe-oss-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/,
	linux-pcmcia-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA,
	linux-pm-u79uwXL29TY76Z2rM5mHXA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	platform-driver-x86-u79uwXL29TY76Z2rM5mHXA,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	dmaengine-u79uwXL29TY76Z2rM5mHXA,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-media-u79uwXL29TY76Z2rM5mHXA

These patches fix cases where the return variable is not set to an error
code in an error case.

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

* [PATCH 0/25] fix error return code
@ 2013-12-29 22:47 ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: linux-input
  Cc: cbe-oss-dev, davinci-linux-open-source, linux-pcmcia, rtc-linux,
	linux-scsi, linux-pm, linux-rdma, netdev, linux-usb,
	kernel-janitors, linux-kernel, platform-driver-x86,
	linux-samsung-soc, linux-mtd, dmaengine, linuxppc-dev,
	linux-arm-kernel, linux-media

These patches fix cases where the return variable is not set to an error
code in an error case.

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

* [PATCH 0/25] fix error return code
@ 2013-12-29 22:47 ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: linux-arm-kernel

These patches fix cases where the return variable is not set to an error
code in an error case.

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

* [PATCH 1/25]  fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Jayamohan Kallickal
  Cc: kernel-janitors, James E.J. Bottomley, linux-scsi, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

Additionally, in each case there is no need to initialize ret to 0, since
its value is immediately overwritten.

A simplified version of the semantic match that finds the first 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>

---
Not tested.

 drivers/scsi/be2iscsi/be_main.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 1f37505..82f4587 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -4326,7 +4326,7 @@ static int beiscsi_get_boot_info(struct beiscsi_hba *phba)
 	struct be_dma_mem nonemb_cmd;
 	unsigned int tag;
 	unsigned int s_handle;
-	int ret = -ENOMEM;
+	int ret;
 
 	/* Get the session handle of the boot target */
 	ret = be_mgmt_get_boot_shandle(phba, &s_handle);
@@ -4356,6 +4356,7 @@ static int beiscsi_get_boot_info(struct beiscsi_hba *phba)
 			    BEISCSI_LOG_INIT | BEISCSI_LOG_CONFIG,
 			    "BM_%d : beiscsi_get_session_info"
 			    " Failed\n");
+		ret = -ENOMEM;
 
 		goto boot_freemem;
 	}
@@ -4455,7 +4456,8 @@ static int beiscsi_init_port(struct beiscsi_hba *phba)
 		goto do_cleanup_ctrlr;
 	}
 
-	if (hba_setup_cid_tbls(phba)) {
+	ret = hba_setup_cid_tbls(phba);
+	if (ret < 0) {
 		beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
 			    "BM_%d : Failed in hba_setup_cid_tbls\n");
 		kfree(phba->io_sgl_hndl_base);
@@ -5479,7 +5481,7 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
 	struct hwi_controller *phwi_ctrlr;
 	struct hwi_context_memory *phwi_context;
 	struct be_eq_obj *pbe_eq;
-	int ret = 0, i;
+	int ret, i;
 
 	ret = beiscsi_enable_pci(pcidev);
 	if (ret < 0) {
@@ -5492,6 +5494,7 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
 	if (!phba) {
 		dev_err(&pcidev->dev,
 			"beiscsi_dev_probe - Failed in beiscsi_hba_alloc\n");
+		ret = -ENOMEM;
 		goto disable_pci;
 	}
 
@@ -5586,6 +5589,7 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
 		beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
 			    "BM_%d : beiscsi_dev_probe-"
 			    "Failed in beiscsi_init_port\n");
+		ret = -ENOMEM;
 		goto free_port;
 	}
 


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

* [PATCH 2/25] rsxx: fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Joshua Morris; +Cc: kernel-janitors, Philip Kelleher, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/block/rsxx/core.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/block/rsxx/core.c b/drivers/block/rsxx/core.c
index a8de2ee..fa8077a 100644
--- a/drivers/block/rsxx/core.c
+++ b/drivers/block/rsxx/core.c
@@ -942,6 +942,7 @@ static int rsxx_pci_probe(struct pci_dev *dev,
 	card->event_wq = create_singlethread_workqueue(DRIVER_NAME"_event");
 	if (!card->event_wq) {
 		dev_err(CARD_TO_DEV(card), "Failed card event setup.\n");
+		st = -ENOMEM;
 		goto failed_event_handler;
 	}
 


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

* [PATCH 3/25]  fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Antti Palosaari
  Cc: kernel-janitors, Mauro Carvalho Chehab, linux-media, linux-kernel

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

The rest of the function uses ret to store the return value, even setting
ret to i a few lines before this, so return ret instead of i.

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>

---
Not tested.

 drivers/media/usb/dvb-usb-v2/ec168.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/dvb-usb-v2/ec168.c b/drivers/media/usb/dvb-usb-v2/ec168.c
index 5c68f39..0c2b377 100644
--- a/drivers/media/usb/dvb-usb-v2/ec168.c
+++ b/drivers/media/usb/dvb-usb-v2/ec168.c
@@ -170,7 +170,7 @@ static int ec168_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
 
 error:
 	mutex_unlock(&d->i2c_mutex);
-	return i;
+	return ret;
 }
 
 static u32 ec168_i2c_func(struct i2c_adapter *adapter)


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

* [PATCH 4/25] UBI: fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Artem Bityutskiy
  Cc: kernel-janitors, David Woodhouse, Brian Norris, linux-mtd, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/mtd/ubi/attach.c |    4 +++-
 drivers/mtd/ubi/build.c  |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index 33bb1f2..6f27d9a 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -1453,8 +1453,10 @@ int ubi_attach(struct ubi_device *ubi, int force_scan)
 		struct ubi_attach_info *scan_ai;
 
 		scan_ai = alloc_ai("ubi_ckh_aeb_slab_cache");
-		if (!scan_ai)
+		if (!scan_ai) {
+			err = -ENOMEM;
 			goto out_wl;
+		}
 
 		err = scan_all(ubi, scan_ai, 0);
 		if (err) {
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index e05dc62..57deae9 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -1245,8 +1245,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] 88+ messages in thread

* [PATCH 4/25] UBI: fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Artem Bityutskiy
  Cc: David Woodhouse, Brian Norris, kernel-janitors, linux-kernel, linux-mtd

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/mtd/ubi/attach.c |    4 +++-
 drivers/mtd/ubi/build.c  |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index 33bb1f2..6f27d9a 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -1453,8 +1453,10 @@ int ubi_attach(struct ubi_device *ubi, int force_scan)
 		struct ubi_attach_info *scan_ai;
 
 		scan_ai = alloc_ai("ubi_ckh_aeb_slab_cache");
-		if (!scan_ai)
+		if (!scan_ai) {
+			err = -ENOMEM;
 			goto out_wl;
+		}
 
 		err = scan_all(ubi, scan_ai, 0);
 		if (err) {
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index e05dc62..57deae9 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -1245,8 +1245,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] 88+ messages in thread

* [PATCH 5/25] IB/mlx4: fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Roland Dreier
  Cc: kernel-janitors, Sean Hefty, Hal Rosenstock, linux-rdma, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/infiniband/hw/mlx4/sysfs.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/sysfs.c b/drivers/infiniband/hw/mlx4/sysfs.c
index 97516eb..db2ea31 100644
--- a/drivers/infiniband/hw/mlx4/sysfs.c
+++ b/drivers/infiniband/hw/mlx4/sysfs.c
@@ -582,8 +582,10 @@ static int add_port(struct mlx4_ib_dev *dev, int port_num, int slave)
 	p->pkey_group.attrs =
 		alloc_group_attrs(show_port_pkey, store_port_pkey,
 				  dev->dev->caps.pkey_table_len[port_num]);
-	if (!p->pkey_group.attrs)
+	if (!p->pkey_group.attrs) {
+		ret = -ENOMEM;
 		goto err_alloc;
+	}
 
 	ret = sysfs_create_group(&p->kobj, &p->pkey_group);
 	if (ret)
@@ -591,8 +593,10 @@ static int add_port(struct mlx4_ib_dev *dev, int port_num, int slave)
 
 	p->gid_group.name  = "gid_idx";
 	p->gid_group.attrs = alloc_group_attrs(show_port_gid_idx, NULL, 1);
-	if (!p->gid_group.attrs)
+	if (!p->gid_group.attrs) {
+		ret = -ENOMEM;
 		goto err_free_pkey;
+	}
 
 	ret = sysfs_create_group(&p->kobj, &p->gid_group);
 	if (ret)

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

* [PATCH 6/25]  fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: kernel-janitors, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

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

diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 3dda09a..a2af73d 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -706,7 +706,9 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command *
 			     WRITE : READ, __GFP_WAIT);
 
 	if (cgc->buflen) {
-		if (blk_rq_map_kern(q, rq, cgc->buffer, cgc->buflen, __GFP_WAIT))
+		ret = blk_rq_map_kern(q, rq, cgc->buffer, cgc->buflen,
+				      __GFP_WAIT);
+		if (ret)
 			goto out;
 	}
 


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

* [PATCH 7/25] net: fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Geoff Levand; +Cc: kernel-janitors, netdev, cbe-oss-dev, linux-kernel

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

Set the return variable to propagate any error code as done elsewhere in
the function.

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>

---
Not tested.

 drivers/net/ethernet/toshiba/ps3_gelic_net.c |   18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.c b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
index f7f2ef4..d899d00 100644
--- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c
+++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
@@ -1739,12 +1739,14 @@ static int ps3_gelic_driver_probe(struct ps3_system_bus_device *dev)
 		GELIC_CARD_PORT_STATUS_CHANGED;
 
 
-	if (gelic_card_init_chain(card, &card->tx_chain,
-			card->descr, GELIC_NET_TX_DESCRIPTORS))
+	result = gelic_card_init_chain(card, &card->tx_chain,
+				       card->descr, GELIC_NET_TX_DESCRIPTORS);
+	if (result)
 		goto fail_alloc_tx;
-	if (gelic_card_init_chain(card, &card->rx_chain,
-				 card->descr + GELIC_NET_TX_DESCRIPTORS,
-				 GELIC_NET_RX_DESCRIPTORS))
+	result = gelic_card_init_chain(card, &card->rx_chain,
+				       card->descr + GELIC_NET_TX_DESCRIPTORS,
+				       GELIC_NET_RX_DESCRIPTORS);
+	if (result)
 		goto fail_alloc_rx;
 
 	/* head of chain */
@@ -1754,7 +1756,8 @@ static int ps3_gelic_driver_probe(struct ps3_system_bus_device *dev)
 		card->rx_top, card->tx_top, sizeof(struct gelic_descr),
 		GELIC_NET_RX_DESCRIPTORS);
 	/* allocate rx skbs */
-	if (gelic_card_alloc_rx_skbs(card))
+	result = gelic_card_alloc_rx_skbs(card);
+	if (result)
 		goto fail_alloc_skbs;
 
 	spin_lock_init(&card->tx_lock);
@@ -1772,7 +1775,8 @@ static int ps3_gelic_driver_probe(struct ps3_system_bus_device *dev)
 	}
 
 #ifdef CONFIG_GELIC_WIRELESS
-	if (gelic_wl_driver_probe(card)) {
+	result = gelic_wl_driver_probe(card);
+	if (result) {
 		dev_dbg(&dev->core, "%s: WL init failed\n", __func__);
 		goto fail_setup_netdev;
 	}


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

* [PATCH 8/25] drivers/dma: fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Vinod Koul; +Cc: kernel-janitors, Dan Williams, dmaengine, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/dma/cppi41.c      |    4 +++-
 drivers/dma/ppc4xx/adma.c |    1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c
index c29dacf..c18aebf 100644
--- a/drivers/dma/cppi41.c
+++ b/drivers/dma/cppi41.c
@@ -972,8 +972,10 @@ static int cppi41_dma_probe(struct platform_device *pdev)
 		goto err_chans;
 
 	irq = irq_of_parse_and_map(dev->of_node, 0);
-	if (!irq)
+	if (!irq) {
+		ret = -EINVAL;
 		goto err_irq;
+	}
 
 	cppi_writel(USBSS_IRQ_PD_COMP, cdd->usbss_mem + USBSS_IRQ_ENABLER);
 
diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c
index 8bba298..ce7a8d7 100644
--- a/drivers/dma/ppc4xx/adma.c
+++ b/drivers/dma/ppc4xx/adma.c
@@ -4114,6 +4114,7 @@ static int ppc440spe_adma_probe(struct platform_device *ofdev)
 	regs = ioremap(res.start, resource_size(&res));
 	if (!regs) {
 		dev_err(&ofdev->dev, "failed to ioremap regs!\n");
+		ret = -ENOMEM;
 		goto err_regs_alloc;
 	}
 


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

* [PATCH 9/25]  fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Hiral Patel
  Cc: kernel-janitors, Suma Ramars, Brian Uchino, James E.J. Bottomley,
	linux-scsi, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/scsi/fnic/fnic_main.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c
index 33e4ec2..a3472a1 100644
--- a/drivers/scsi/fnic/fnic_main.c
+++ b/drivers/scsi/fnic/fnic_main.c
@@ -731,17 +731,23 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		spin_lock_init(&fnic->io_req_lock[i]);
 
 	fnic->io_req_pool = mempool_create_slab_pool(2, fnic_io_req_cache);
-	if (!fnic->io_req_pool)
+	if (!fnic->io_req_pool) {
+		err = -ENOMEM;
 		goto err_out_free_resources;
+	}
 
 	pool = mempool_create_slab_pool(2, fnic_sgl_cache[FNIC_SGL_CACHE_DFLT]);
-	if (!pool)
+	if (!pool) {
+		err = -ENOMEM;
 		goto err_out_free_ioreq_pool;
+	}
 	fnic->io_sgl_pool[FNIC_SGL_CACHE_DFLT] = pool;
 
 	pool = mempool_create_slab_pool(2, fnic_sgl_cache[FNIC_SGL_CACHE_MAX]);
-	if (!pool)
+	if (!pool) {
+		err = -ENOMEM;
 		goto err_out_free_dflt_pool;
+	}
 	fnic->io_sgl_pool[FNIC_SGL_CACHE_MAX] = pool;
 
 	/* setup vlan config, hw inserts vlan header */


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

* [PATCH 10/25] usb: gadget: fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: kernel-janitors, Greg Kroah-Hartman, linux-usb, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/usb/gadget/printer.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c
index bf7a56b..92b55bd 100644
--- a/drivers/usb/gadget/printer.c
+++ b/drivers/usb/gadget/printer.c
@@ -1133,6 +1133,7 @@ static int __init printer_bind_config(struct usb_configuration *c)
 				  NULL, "g_printer");
 	if (IS_ERR(dev->pdev)) {
 		ERROR(dev, "Failed to create device: g_printer\n");
+		status = PTR_ERR(dev->pdev);
 		goto fail;
 	}
 


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

* [PATCH 11/25] pcmcia: fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: linux-pcmcia; +Cc: kernel-janitors, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/pcmcia/electra_cf.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/pcmcia/electra_cf.c b/drivers/pcmcia/electra_cf.c
index 5ea64d0..b012bd9 100644
--- a/drivers/pcmcia/electra_cf.c
+++ b/drivers/pcmcia/electra_cf.c
@@ -251,23 +251,31 @@ static int electra_cf_probe(struct platform_device *ofdev)
 	cf->socket.pci_irq = cf->irq;
 
 	prop = of_get_property(np, "card-detect-gpio", NULL);
-	if (!prop)
+	if (!prop) {
+		status = -ENODEV;
 		goto fail1;
+	}
 	cf->gpio_detect = *prop;
 
 	prop = of_get_property(np, "card-vsense-gpio", NULL);
-	if (!prop)
+	if (!prop) {
+		status = -ENODEV;
 		goto fail1;
+	}
 	cf->gpio_vsense = *prop;
 
 	prop = of_get_property(np, "card-3v-gpio", NULL);
-	if (!prop)
+	if (!prop) {
+		status = -ENODEV;
 		goto fail1;
+	}
 	cf->gpio_3v = *prop;
 
 	prop = of_get_property(np, "card-5v-gpio", NULL);
-	if (!prop)
+	if (!prop) {
+		status = -ENODEV;
 		goto fail1;
+	}
 	cf->gpio_5v = *prop;
 
 	cf->socket.io_offset = cf->io_base;


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

* [PATCH 12/25] HID: sony: fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: kernel-janitors, linux-input, linux-kernel

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

Currently the return variable ret is always 0.  Set it to other values in
error cases, as used in the direct return.

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>

---
Not tested.

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

diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index b60bc38..f57ab5e 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -585,6 +585,7 @@ static int sony_leds_init(struct hid_device *hdev)
 		led = kzalloc(sizeof(struct led_classdev) + name_sz, GFP_KERNEL);
 		if (!led) {
 			hid_err(hdev, "Couldn't allocate memory for LED %d\n", n);
+			ret = -ENOMEM;
 			goto error_leds;
 		}
 
@@ -596,7 +597,8 @@ static int sony_leds_init(struct hid_device *hdev)
 		led->brightness_get = sony_led_get_brightness;
 		led->brightness_set = sony_led_set_brightness;
 
-		if (led_classdev_register(&hdev->dev, led)) {
+		ret = led_classdev_register(&hdev->dev, led);
+		if (ret) {
 			hid_err(hdev, "Failed to register LED %d\n", n);
 			kfree(led);
 			goto error_leds;


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

* [PATCH 13/25] hamradio: 6pack: fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: ajk, linux-hams, netdev; +Cc: kernel-janitors, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/net/hamradio/6pack.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
index 1450e33..66e2b19 100644
--- a/drivers/net/hamradio/6pack.c
+++ b/drivers/net/hamradio/6pack.c
@@ -662,7 +662,8 @@ static int sixpack_open(struct tty_struct *tty)
 	tty->receive_room = 65536;
 
 	/* Now we're ready to register. */
-	if (register_netdev(dev))
+	err = register_netdev(dev);
+	if (err)
 		goto out_free;
 
 	tnc_init(sp);

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

* [PATCH 14/25] RDMA/amso1100: fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Tom Tucker
  Cc: kernel-janitors, Steve Wise, Roland Dreier, Sean Hefty,
	Hal Rosenstock, linux-rdma, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/infiniband/hw/amso1100/c2.c      |    4 +++-
 drivers/infiniband/hw/amso1100/c2_rnic.c |    3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/amso1100/c2.c b/drivers/infiniband/hw/amso1100/c2.c
index d53cf51..00400c3 100644
--- a/drivers/infiniband/hw/amso1100/c2.c
+++ b/drivers/infiniband/hw/amso1100/c2.c
@@ -1082,6 +1082,7 @@ static int c2_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
 
 	/* Initialize network device */
 	if ((netdev = c2_devinit(c2dev, mmio_regs)) == NULL) {
+		ret = -ENOMEM;
 		iounmap(mmio_regs);
 		goto bail4;
 	}
@@ -1151,7 +1152,8 @@ static int c2_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
 		goto bail10;
 	}
 
-	if (c2_register_device(c2dev))
+	ret = c2_register_device(c2dev);
+	if (ret)
 		goto bail10;
 
 	return 0;
diff --git a/drivers/infiniband/hw/amso1100/c2_rnic.c b/drivers/infiniband/hw/amso1100/c2_rnic.c
index b7c9869..d2a6d96 100644
--- a/drivers/infiniband/hw/amso1100/c2_rnic.c
+++ b/drivers/infiniband/hw/amso1100/c2_rnic.c
@@ -576,7 +576,8 @@ int c2_rnic_init(struct c2_dev *c2dev)
 		goto bail4;
 
 	/* Initialize cached the adapter limits */
-	if (c2_rnic_query(c2dev, &c2dev->props))
+	err = c2_rnic_query(c2dev, &c2dev->props);
+	if (err)
 		goto bail5;
 
 	/* Initialize the PD pool */

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

* [PATCH 17/25]  fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/char/xilinx_hwicap/xilinx_hwicap.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
index f6345f9..9b1a5ac 100644
--- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c
+++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
@@ -661,6 +661,7 @@ static int hwicap_setup(struct device *dev, int id,
 	drvdata->base_address = ioremap(drvdata->mem_start, drvdata->mem_size);
 	if (!drvdata->base_address) {
 		dev_err(dev, "ioremap() failed\n");
+		retval = -ENOMEM;
 		goto failed2;
 	}
 


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

* [PATCH 16/25] block: fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/cdrom/gdrom.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c
index 51e75ad..93d29b1 100644
--- a/drivers/cdrom/gdrom.c
+++ b/drivers/cdrom/gdrom.c
@@ -807,16 +807,20 @@ static int probe_gdrom(struct platform_device *devptr)
 	if (err)
 		goto probe_fail_cmdirq_register;
 	gd.gdrom_rq = blk_init_queue(gdrom_request, &gdrom_lock);
-	if (!gd.gdrom_rq)
+	if (!gd.gdrom_rq) {
+		err = -ENOMEM;
 		goto probe_fail_requestq;
+	}
 
 	err = probe_gdrom_setupqueue();
 	if (err)
 		goto probe_fail_toc;
 
 	gd.toc = kzalloc(sizeof(struct gdromtoc), GFP_KERNEL);
-	if (!gd.toc)
+	if (!gd.toc) {
+		err = -ENOMEM;
 		goto probe_fail_toc;
+	}
 	add_disk(gd.disk);
 	return 0;
 


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

* [PATCH 15/25]  fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/block/umem.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/block/umem.c b/drivers/block/umem.c
index 4cf81b5..371e819 100644
--- a/drivers/block/umem.c
+++ b/drivers/block/umem.c
@@ -881,6 +881,7 @@ static int mm_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	if (card->mm_pages[0].desc == NULL ||
 	    card->mm_pages[1].desc == NULL) {
 		dev_printk(KERN_ERR, &card->dev->dev, "alloc failed\n");
+		ret = -ENOMEM;
 		goto failed_alloc;
 	}
 	reset_page(&card->mm_pages[0]);
@@ -891,8 +892,10 @@ static int mm_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	card->biotail = &card->bio;
 
 	card->queue = blk_alloc_queue(GFP_KERNEL);
-	if (!card->queue)
+	if (!card->queue) {
+		ret = -ENOMEM;
 		goto failed_alloc;
+	}
 
 	blk_queue_make_request(card->queue, mm_make_request);
 	card->queue->queue_lock = &card->lock;


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

* [PATCH 18/25] mtd: nand: fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: David Woodhouse; +Cc: kernel-janitors, Brian Norris, linux-mtd, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/mtd/nand/fsmc_nand.c    |    3 +++
 drivers/mtd/tests/oobtest.c     |    1 +
 drivers/mtd/tests/pagetest.c    |    1 +
 drivers/mtd/tests/subpagetest.c |    1 +
 4 files changed, 6 insertions(+)

diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index 8b27522..6f8c4f5 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -1040,12 +1040,15 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
 				pdata->read_dma_priv);
 		if (!host->read_dma_chan) {
 			dev_err(&pdev->dev, "Unable to get read dma channel\n");
+			ret = -EBUSY;
 			goto err_req_read_chnl;
 		}
 		host->write_dma_chan = dma_request_channel(mask, filter,
 				pdata->write_dma_priv);
 		if (!host->write_dma_chan) {
 			dev_err(&pdev->dev, "Unable to get write dma channel\n");
+
+			ret = -EBUSY;
 			goto err_req_write_chnl;
 		}
 		nand->read_buf = fsmc_read_buf_dma;
diff --git a/drivers/mtd/tests/oobtest.c b/drivers/mtd/tests/oobtest.c
index 2e9e2d1..26688e9 100644
--- a/drivers/mtd/tests/oobtest.c
+++ b/drivers/mtd/tests/oobtest.c
@@ -291,6 +291,7 @@ static int __init mtd_oobtest_init(void)
 
 	if (!mtd_type_is_nand(mtd)) {
 		pr_info("this test requires NAND flash\n");
+		err = -ENODEV;
 		goto out;
 	}
 
diff --git a/drivers/mtd/tests/pagetest.c b/drivers/mtd/tests/pagetest.c
index ed2d3f6..9a84460 100644
--- a/drivers/mtd/tests/pagetest.c
+++ b/drivers/mtd/tests/pagetest.c
@@ -355,6 +355,7 @@ static int __init mtd_pagetest_init(void)
 
 	if (!mtd_type_is_nand(mtd)) {
 		pr_info("this test requires NAND flash\n");
+		err = -ENODEV;
 		goto out;
 	}
 
diff --git a/drivers/mtd/tests/subpagetest.c b/drivers/mtd/tests/subpagetest.c
index a876371..2baa93d 100644
--- a/drivers/mtd/tests/subpagetest.c
+++ b/drivers/mtd/tests/subpagetest.c
@@ -301,6 +301,7 @@ static int __init mtd_subpagetest_init(void)
 
 	if (!mtd_type_is_nand(mtd)) {
 		pr_info("this test requires NAND flash\n");
+		err = -ENODEV;
 		goto out;
 	}
 


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

* [PATCH 18/25] mtd: nand: fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: David Woodhouse; +Cc: linux-mtd, Brian Norris, kernel-janitors, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/mtd/nand/fsmc_nand.c    |    3 +++
 drivers/mtd/tests/oobtest.c     |    1 +
 drivers/mtd/tests/pagetest.c    |    1 +
 drivers/mtd/tests/subpagetest.c |    1 +
 4 files changed, 6 insertions(+)

diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index 8b27522..6f8c4f5 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -1040,12 +1040,15 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
 				pdata->read_dma_priv);
 		if (!host->read_dma_chan) {
 			dev_err(&pdev->dev, "Unable to get read dma channel\n");
+			ret = -EBUSY;
 			goto err_req_read_chnl;
 		}
 		host->write_dma_chan = dma_request_channel(mask, filter,
 				pdata->write_dma_priv);
 		if (!host->write_dma_chan) {
 			dev_err(&pdev->dev, "Unable to get write dma channel\n");
+
+			ret = -EBUSY;
 			goto err_req_write_chnl;
 		}
 		nand->read_buf = fsmc_read_buf_dma;
diff --git a/drivers/mtd/tests/oobtest.c b/drivers/mtd/tests/oobtest.c
index 2e9e2d1..26688e9 100644
--- a/drivers/mtd/tests/oobtest.c
+++ b/drivers/mtd/tests/oobtest.c
@@ -291,6 +291,7 @@ static int __init mtd_oobtest_init(void)
 
 	if (!mtd_type_is_nand(mtd)) {
 		pr_info("this test requires NAND flash\n");
+		err = -ENODEV;
 		goto out;
 	}
 
diff --git a/drivers/mtd/tests/pagetest.c b/drivers/mtd/tests/pagetest.c
index ed2d3f6..9a84460 100644
--- a/drivers/mtd/tests/pagetest.c
+++ b/drivers/mtd/tests/pagetest.c
@@ -355,6 +355,7 @@ static int __init mtd_pagetest_init(void)
 
 	if (!mtd_type_is_nand(mtd)) {
 		pr_info("this test requires NAND flash\n");
+		err = -ENODEV;
 		goto out;
 	}
 
diff --git a/drivers/mtd/tests/subpagetest.c b/drivers/mtd/tests/subpagetest.c
index a876371..2baa93d 100644
--- a/drivers/mtd/tests/subpagetest.c
+++ b/drivers/mtd/tests/subpagetest.c
@@ -301,6 +301,7 @@ static int __init mtd_subpagetest_init(void)
 
 	if (!mtd_type_is_nand(mtd)) {
 		pr_info("this test requires NAND flash\n");
+		err = -ENODEV;
 		goto out;
 	}
 

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

* [PATCH 19/25]  fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Geoff Levand
  Cc: kernel-janitors, James E.J. Bottomley, linuxppc-dev, cbe-oss-dev,
	linux-scsi, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/scsi/ps3rom.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c
index e6e2a30..04d77ce 100644
--- a/drivers/scsi/ps3rom.c
+++ b/drivers/scsi/ps3rom.c
@@ -387,6 +387,7 @@ static int ps3rom_probe(struct ps3_system_bus_device *_dev)
 	if (!host) {
 		dev_err(&dev->sbd.core, "%s:%u: scsi_host_alloc failed\n",
 			__func__, __LINE__);
+		error = -ENOMEM;
 		goto fail_teardown;
 	}
 


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

* [PATCH 19/25]  fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Geoff Levand
  Cc: cbe-oss-dev, linux-scsi, kernel-janitors, linux-kernel,
	James E.J. Bottomley, linuxppc-dev

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/scsi/ps3rom.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c
index e6e2a30..04d77ce 100644
--- a/drivers/scsi/ps3rom.c
+++ b/drivers/scsi/ps3rom.c
@@ -387,6 +387,7 @@ static int ps3rom_probe(struct ps3_system_bus_device *_dev)
 	if (!host) {
 		dev_err(&dev->sbd.core, "%s:%u: scsi_host_alloc failed\n",
 			__func__, __LINE__);
+		error = -ENOMEM;
 		goto fail_teardown;
 	}
 

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

* [PATCH 20/25]  fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Antti Palosaari
  Cc: kernel-janitors, Mauro Carvalho Chehab, linux-media, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/media/tuners/e4000.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/media/tuners/e4000.c b/drivers/media/tuners/e4000.c
index 72971a8..40c1da7 100644
--- a/drivers/media/tuners/e4000.c
+++ b/drivers/media/tuners/e4000.c
@@ -243,8 +243,10 @@ static int e4000_set_params(struct dvb_frontend *fe)
 			break;
 	}
 
-	if (i == ARRAY_SIZE(e4000_pll_lut))
+	if (i == ARRAY_SIZE(e4000_pll_lut)) {
+		ret = -EINVAL;
 		goto err;
+	}
 
 	/*
 	 * Note: Currently f_vco overflows when c->frequency is 1 073 741 824 Hz
@@ -271,8 +273,10 @@ static int e4000_set_params(struct dvb_frontend *fe)
 			break;
 	}
 
-	if (i == ARRAY_SIZE(e400_lna_filter_lut))
+	if (i == ARRAY_SIZE(e400_lna_filter_lut)) {
+		ret = -EINVAL;
 		goto err;
+	}
 
 	ret = e4000_wr_reg(priv, 0x10, e400_lna_filter_lut[i].val);
 	if (ret < 0)
@@ -284,8 +288,10 @@ static int e4000_set_params(struct dvb_frontend *fe)
 			break;
 	}
 
-	if (i == ARRAY_SIZE(e4000_if_filter_lut))
+	if (i == ARRAY_SIZE(e4000_if_filter_lut)) {
+		ret = -EINVAL;
 		goto err;
+	}
 
 	buf[0] = e4000_if_filter_lut[i].reg11_val;
 	buf[1] = e4000_if_filter_lut[i].reg12_val;
@@ -300,8 +306,10 @@ static int e4000_set_params(struct dvb_frontend *fe)
 			break;
 	}
 
-	if (i == ARRAY_SIZE(e4000_band_lut))
+	if (i == ARRAY_SIZE(e4000_band_lut)) {
+		ret = -EINVAL;
 		goto err;
+	}
 
 	ret = e4000_wr_reg(priv, 0x07, e4000_band_lut[i].reg07_val);
 	if (ret < 0)


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

* [PATCH 21/25] fujitsu-laptop: fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Jonathan Woithe
  Cc: kernel-janitors, Matthew Garrett, platform-driver-x86, linux-kernel

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

These functions mix the use of result and error.  In acpi_fujitsu_add,
result does not seem useful; it would seem reasonable to propagate the
return value of acpi_bus_update_power in an error case.  On the other hand,
in the case of acpi_fujitsu_hotkey_add, there is an initialization of
result that can lead to what looks like a failure case, but that does not
abort the function.  The variable result is kept for this case.

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>

---
Not tested.  Not sure to be doing the right thing with result in the second
case.

 drivers/platform/x86/fujitsu-laptop.c |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index 9d30d69..be02bcc 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -633,7 +633,6 @@ static struct dmi_system_id fujitsu_dmi_table[] = {
 
 static int acpi_fujitsu_add(struct acpi_device *device)
 {
-	int result = 0;
 	int state = 0;
 	struct input_dev *input;
 	int error;
@@ -669,8 +668,8 @@ static int acpi_fujitsu_add(struct acpi_device *device)
 	if (error)
 		goto err_free_input_dev;
 
-	result = acpi_bus_update_power(fujitsu->acpi_handle, &state);
-	if (result) {
+	error = acpi_bus_update_power(fujitsu->acpi_handle, &state);
+	if (error) {
 		pr_err("Error reading power state\n");
 		goto err_unregister_input_dev;
 	}
@@ -700,7 +699,7 @@ static int acpi_fujitsu_add(struct acpi_device *device)
 		fujitsu->max_brightness = FUJITSU_LCD_N_LEVELS;
 	get_lcd_level();
 
-	return result;
+	return 0;
 
 err_unregister_input_dev:
 	input_unregister_device(input);
@@ -708,7 +707,7 @@ err_unregister_input_dev:
 err_free_input_dev:
 	input_free_device(input);
 err_stop:
-	return result;
+	return error;
 }
 
 static int acpi_fujitsu_remove(struct acpi_device *device)
@@ -831,8 +830,8 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
 	if (error)
 		goto err_free_input_dev;
 
-	result = acpi_bus_update_power(fujitsu_hotkey->acpi_handle, &state);
-	if (result) {
+	error = acpi_bus_update_power(fujitsu_hotkey->acpi_handle, &state);
+	if (error) {
 		pr_err("Error reading power state\n");
 		goto err_unregister_input_dev;
 	}
@@ -907,7 +906,7 @@ err_free_input_dev:
 err_free_fifo:
 	kfifo_free(&fujitsu_hotkey->fifo);
 err_stop:
-	return result;
+	return error;
 }
 
 static int acpi_fujitsu_hotkey_remove(struct acpi_device *device)


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

* [PATCH 22/25] RDMA/nes: fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Faisal Latif
  Cc: kernel-janitors, Roland Dreier, Sean Hefty, Hal Rosenstock,
	linux-rdma, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/infiniband/hw/nes/nes.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c
index 4291410..353c7b0 100644
--- a/drivers/infiniband/hw/nes/nes.c
+++ b/drivers/infiniband/hw/nes/nes.c
@@ -675,8 +675,11 @@ static int nes_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
 	INIT_DELAYED_WORK(&nesdev->work, nes_recheck_link_status);
 
 	/* Initialize network devices */
-	if ((netdev = nes_netdev_init(nesdev, mmio_regs)) == NULL)
+	netdev = nes_netdev_init(nesdev, mmio_regs);
+	if (netdev == NULL) {
+		ret = -ENOMEM;
 		goto bail7;
+	}
 
 	/* Register network device */
 	ret = register_netdev(netdev);

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

* [PATCH 23/25] thermal: exynos: fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Zhang Rui
  Cc: kernel-janitors, Eduardo Valentin, Kukjin Kim, linux-pm,
	linux-arm-kernel, linux-samsung-soc, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/thermal/samsung/exynos_tmu.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 32f38b9..0d96a51 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -205,6 +205,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
 skip_calib_data:
 	if (pdata->max_trigger_level > MAX_THRESHOLD_LEVS) {
 		dev_err(&pdev->dev, "Invalid max trigger level\n");
+		ret = -EINVAL;
 		goto out;
 	}
 


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

* [PATCH 23/25] thermal: exynos: fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: linux-arm-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/thermal/samsung/exynos_tmu.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 32f38b9..0d96a51 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -205,6 +205,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
 skip_calib_data:
 	if (pdata->max_trigger_level > MAX_THRESHOLD_LEVS) {
 		dev_err(&pdev->dev, "Invalid max trigger level\n");
+		ret = -EINVAL;
 		goto out;
 	}
 

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

* [PATCH 24/25]  fix error return code
@ 2013-12-29 22:47   ` Julia Lawall
  0 siblings, 0 replies; 88+ messages in thread
From: Julia Lawall @ 2013-12-29 22:47 UTC (permalink / raw)
  To: Eddie Wai; +Cc: kernel-janitors, James E.J. Bottomley, linux-scsi, linux-kernel

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

Set the return variable to an error code as done elsewhere in the function.

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>

---
Not tested.

 drivers/scsi/bnx2fc/bnx2fc_fcoe.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 9b94850..d8cb194 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -2199,6 +2199,7 @@ static int _bnx2fc_create(struct net_device *netdev,
 	interface = bnx2fc_interface_create(hba, netdev, fip_mode);
 	if (!interface) {
 		printk(KERN_ERR PFX "bnx2fc_interface_create failed\n");
+		rc = -ENOMEM;
 		goto ifput_err;
 	}
 


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

* Re: [PATCH 23/25] thermal: exynos: fix error return code
  2013-12-29 22:47   ` Julia Lawall
  (?)
@ 2013-12-30  1:31     ` Jingoo Han
  -1 siblings, 0 replies; 88+ messages in thread
From: Jingoo Han @ 2013-12-30  1:31 UTC (permalink / raw)
  To: 'Julia Lawall', 'Zhang Rui'
  Cc: kernel-janitors, 'Eduardo Valentin', 'Kukjin Kim',
	linux-pm, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	'Jingoo Han', 'Amit Daniel Kachhap',
	'Jonghwa Lee', 'Lukasz Majewski'

On Monday, December 30, 2013 7:48 AM, Julia Lawall wrote:
> 
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Set the return variable to an error code as done elsewhere in the function.
> 
> 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>

(+cc Amit Daniel Kachhap, Jonghwa Lee)

Reviewed-by: Jingoo Han <jg1.han@samsung.com>

Best regards,
Jingoo Han

> 
> ---
> Not tested.
> 
>  drivers/thermal/samsung/exynos_tmu.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index 32f38b9..0d96a51 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -205,6 +205,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
>  skip_calib_data:
>  	if (pdata->max_trigger_level > MAX_THRESHOLD_LEVS) {
>  		dev_err(&pdev->dev, "Invalid max trigger level\n");
> +		ret = -EINVAL;
>  		goto out;
>  	}
> 
> 
> --


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

* Re: [PATCH 23/25] thermal: exynos: fix error return code
@ 2013-12-30  1:31     ` Jingoo Han
  0 siblings, 0 replies; 88+ messages in thread
From: Jingoo Han @ 2013-12-30  1:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday, December 30, 2013 7:48 AM, Julia Lawall wrote:
> 
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Set the return variable to an error code as done elsewhere in the function.
> 
> 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>

(+cc Amit Daniel Kachhap, Jonghwa Lee)

Reviewed-by: Jingoo Han <jg1.han@samsung.com>

Best regards,
Jingoo Han

> 
> ---
> Not tested.
> 
>  drivers/thermal/samsung/exynos_tmu.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index 32f38b9..0d96a51 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -205,6 +205,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
>  skip_calib_data:
>  	if (pdata->max_trigger_level > MAX_THRESHOLD_LEVS) {
>  		dev_err(&pdev->dev, "Invalid max trigger level\n");
> +		ret = -EINVAL;
>  		goto out;
>  	}
> 
> 
> --


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

* [PATCH 23/25] thermal: exynos: fix error return code
@ 2013-12-30  1:31     ` Jingoo Han
  0 siblings, 0 replies; 88+ messages in thread
From: Jingoo Han @ 2013-12-30  1:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday, December 30, 2013 7:48 AM, Julia Lawall wrote:
> 
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Set the return variable to an error code as done elsewhere in the function.
> 
> 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>

(+cc Amit Daniel Kachhap, Jonghwa Lee)

Reviewed-by: Jingoo Han <jg1.han@samsung.com>

Best regards,
Jingoo Han

> 
> ---
> Not tested.
> 
>  drivers/thermal/samsung/exynos_tmu.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index 32f38b9..0d96a51 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -205,6 +205,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
>  skip_calib_data:
>  	if (pdata->max_trigger_level > MAX_THRESHOLD_LEVS) {
>  		dev_err(&pdev->dev, "Invalid max trigger level\n");
> +		ret = -EINVAL;
>  		goto out;
>  	}
> 
> 
> --

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

* Re: [PATCH 5/25] IB/mlx4: fix error return code
  2013-12-29 22:47   ` Julia Lawall
  (?)
@ 2013-12-31  7:52       ` Jack Morgenstein
  -1 siblings, 0 replies; 88+ messages in thread
From: Jack Morgenstein @ 2013-12-31  7:52 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Roland Dreier, kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	Sean Hefty, Hal Rosenstock, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz

On Sun, 29 Dec 2013 23:47:20 +0100
Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org> wrote:

> diff --git a/drivers/infiniband/hw/mlx4/sysfs.c
> b/drivers/infiniband/hw/mlx4/sysfs.c index 97516eb..db2ea31 100644
> --- a/drivers/infiniband/hw/mlx4/sysfs.c
> +++ b/drivers/infiniband/hw/mlx4/sysfs.c
> @@ -582,8 +582,10 @@ static int add_port(struct mlx4_ib_dev *dev, int
> port_num, int slave) p->pkey_group.attrs =
>  		alloc_group_attrs(show_port_pkey, store_port_pkey,
>  				  dev->dev->caps.pkey_table_len[port_num]);
> -	if (!p->pkey_group.attrs)
> +	if (!p->pkey_group.attrs) {
> +		ret = -ENOMEM;
>  		goto err_alloc;
> +	}
>  
>  	ret = sysfs_create_group(&p->kobj, &p->pkey_group);
>  	if (ret)
> @@ -591,8 +593,10 @@ static int add_port(struct mlx4_ib_dev *dev, int
> port_num, int slave) 
>  	p->gid_group.name  = "gid_idx";
>  	p->gid_group.attrs = alloc_group_attrs(show_port_gid_idx,
> NULL, 1);
> -	if (!p->gid_group.attrs)
> +	if (!p->gid_group.attrs) {
> +		ret = -ENOMEM;
>  		goto err_free_pkey;
> +	}
>  

ACK. Julia's patch is correct -- this is indeed a bug-fix.

-Jack
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 5/25] IB/mlx4: fix error return code
@ 2013-12-31  7:52       ` Jack Morgenstein
  0 siblings, 0 replies; 88+ messages in thread
From: Jack Morgenstein @ 2013-12-31  7:52 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Roland Dreier, kernel-janitors, Sean Hefty, Hal Rosenstock,
	linux-rdma, linux-kernel, Or Gerlitz

On Sun, 29 Dec 2013 23:47:20 +0100
Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> diff --git a/drivers/infiniband/hw/mlx4/sysfs.c
> b/drivers/infiniband/hw/mlx4/sysfs.c index 97516eb..db2ea31 100644
> --- a/drivers/infiniband/hw/mlx4/sysfs.c
> +++ b/drivers/infiniband/hw/mlx4/sysfs.c
> @@ -582,8 +582,10 @@ static int add_port(struct mlx4_ib_dev *dev, int
> port_num, int slave) p->pkey_group.attrs =
>  		alloc_group_attrs(show_port_pkey, store_port_pkey,
>  				  dev->dev->caps.pkey_table_len[port_num]);
> -	if (!p->pkey_group.attrs)
> +	if (!p->pkey_group.attrs) {
> +		ret = -ENOMEM;
>  		goto err_alloc;
> +	}
>  
>  	ret = sysfs_create_group(&p->kobj, &p->pkey_group);
>  	if (ret)
> @@ -591,8 +593,10 @@ static int add_port(struct mlx4_ib_dev *dev, int
> port_num, int slave) 
>  	p->gid_group.name  = "gid_idx";
>  	p->gid_group.attrs = alloc_group_attrs(show_port_gid_idx,
> NULL, 1);
> -	if (!p->gid_group.attrs)
> +	if (!p->gid_group.attrs) {
> +		ret = -ENOMEM;
>  		goto err_free_pkey;
> +	}
>  

ACK. Julia's patch is correct -- this is indeed a bug-fix.

-Jack

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

* Re: [PATCH 5/25] IB/mlx4: fix error return code
@ 2013-12-31  7:52       ` Jack Morgenstein
  0 siblings, 0 replies; 88+ messages in thread
From: Jack Morgenstein @ 2013-12-31  7:52 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Roland Dreier, kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	Sean Hefty, Hal Rosenstock, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Or Gerlitz

On Sun, 29 Dec 2013 23:47:20 +0100
Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> diff --git a/drivers/infiniband/hw/mlx4/sysfs.c
> b/drivers/infiniband/hw/mlx4/sysfs.c index 97516eb..db2ea31 100644
> --- a/drivers/infiniband/hw/mlx4/sysfs.c
> +++ b/drivers/infiniband/hw/mlx4/sysfs.c
> @@ -582,8 +582,10 @@ static int add_port(struct mlx4_ib_dev *dev, int
> port_num, int slave) p->pkey_group.attrs >  		alloc_group_attrs(show_port_pkey, store_port_pkey,
>  				  dev->dev->caps.pkey_table_len[port_num]);
> -	if (!p->pkey_group.attrs)
> +	if (!p->pkey_group.attrs) {
> +		ret = -ENOMEM;
>  		goto err_alloc;
> +	}
>  
>  	ret = sysfs_create_group(&p->kobj, &p->pkey_group);
>  	if (ret)
> @@ -591,8 +593,10 @@ static int add_port(struct mlx4_ib_dev *dev, int
> port_num, int slave) 
>  	p->gid_group.name  = "gid_idx";
>  	p->gid_group.attrs = alloc_group_attrs(show_port_gid_idx,
> NULL, 1);
> -	if (!p->gid_group.attrs)
> +	if (!p->gid_group.attrs) {
> +		ret = -ENOMEM;
>  		goto err_free_pkey;
> +	}
>  

ACK. Julia's patch is correct -- this is indeed a bug-fix.

-Jack

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

* Re: [PATCH 4/25] UBI: fix error return code
  2013-12-29 22:47   ` Julia Lawall
  (?)
@ 2013-12-31 11:30     ` Richard Weinberger
  -1 siblings, 0 replies; 88+ messages in thread
From: Richard Weinberger @ 2013-12-31 11:30 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Artem Bityutskiy, kernel-janitors, David Woodhouse, Brian Norris,
	linux-mtd, LKML

On Sun, Dec 29, 2013 at 11:47 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Set the return variable to an error code as done elsewhere in the function.
>
> 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>

Reviewed-by: Richard Weinberger <richard@nod.at>

> ---
> Not tested.
>
>  drivers/mtd/ubi/attach.c |    4 +++-
>  drivers/mtd/ubi/build.c  |    4 +++-
>  2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
> index 33bb1f2..6f27d9a 100644
> --- a/drivers/mtd/ubi/attach.c
> +++ b/drivers/mtd/ubi/attach.c
> @@ -1453,8 +1453,10 @@ int ubi_attach(struct ubi_device *ubi, int force_scan)
>                 struct ubi_attach_info *scan_ai;
>
>                 scan_ai = alloc_ai("ubi_ckh_aeb_slab_cache");
> -               if (!scan_ai)
> +               if (!scan_ai) {
> +                       err = -ENOMEM;
>                         goto out_wl;
> +               }
>
>                 err = scan_all(ubi, scan_ai, 0);
>                 if (err) {
> diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
> index e05dc62..57deae9 100644
> --- a/drivers/mtd/ubi/build.c
> +++ b/drivers/mtd/ubi/build.c
> @@ -1245,8 +1245,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)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



-- 
Thanks,
//richard

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

* Re: [PATCH 4/25] UBI: fix error return code
@ 2013-12-31 11:30     ` Richard Weinberger
  0 siblings, 0 replies; 88+ messages in thread
From: Richard Weinberger @ 2013-12-31 11:30 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Artem Bityutskiy, kernel-janitors, LKML, linux-mtd, Brian Norris,
	David Woodhouse

On Sun, Dec 29, 2013 at 11:47 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Set the return variable to an error code as done elsewhere in the function.
>
> 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>

Reviewed-by: Richard Weinberger <richard@nod.at>

> ---
> Not tested.
>
>  drivers/mtd/ubi/attach.c |    4 +++-
>  drivers/mtd/ubi/build.c  |    4 +++-
>  2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
> index 33bb1f2..6f27d9a 100644
> --- a/drivers/mtd/ubi/attach.c
> +++ b/drivers/mtd/ubi/attach.c
> @@ -1453,8 +1453,10 @@ int ubi_attach(struct ubi_device *ubi, int force_scan)
>                 struct ubi_attach_info *scan_ai;
>
>                 scan_ai = alloc_ai("ubi_ckh_aeb_slab_cache");
> -               if (!scan_ai)
> +               if (!scan_ai) {
> +                       err = -ENOMEM;
>                         goto out_wl;
> +               }
>
>                 err = scan_all(ubi, scan_ai, 0);
>                 if (err) {
> diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
> index e05dc62..57deae9 100644
> --- a/drivers/mtd/ubi/build.c
> +++ b/drivers/mtd/ubi/build.c
> @@ -1245,8 +1245,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)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



-- 
Thanks,
//richard

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

* Re: [PATCH 4/25] UBI: fix error return code
@ 2013-12-31 11:30     ` Richard Weinberger
  0 siblings, 0 replies; 88+ messages in thread
From: Richard Weinberger @ 2013-12-31 11:30 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Artem Bityutskiy, kernel-janitors, LKML, linux-mtd, Brian Norris,
	David Woodhouse

On Sun, Dec 29, 2013 at 11:47 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Set the return variable to an error code as done elsewhere in the function.
>
> 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>

Reviewed-by: Richard Weinberger <richard@nod.at>

> ---
> Not tested.
>
>  drivers/mtd/ubi/attach.c |    4 +++-
>  drivers/mtd/ubi/build.c  |    4 +++-
>  2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
> index 33bb1f2..6f27d9a 100644
> --- a/drivers/mtd/ubi/attach.c
> +++ b/drivers/mtd/ubi/attach.c
> @@ -1453,8 +1453,10 @@ int ubi_attach(struct ubi_device *ubi, int force_scan)
>                 struct ubi_attach_info *scan_ai;
>
>                 scan_ai = alloc_ai("ubi_ckh_aeb_slab_cache");
> -               if (!scan_ai)
> +               if (!scan_ai) {
> +                       err = -ENOMEM;
>                         goto out_wl;
> +               }
>
>                 err = scan_all(ubi, scan_ai, 0);
>                 if (err) {
> diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
> index e05dc62..57deae9 100644
> --- a/drivers/mtd/ubi/build.c
> +++ b/drivers/mtd/ubi/build.c
> @@ -1245,8 +1245,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)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



-- 
Thanks,
//richard

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

* Re: [PATCH 21/25] fujitsu-laptop: fix error return code
  2013-12-29 22:47   ` Julia Lawall
@ 2013-12-31 13:17     ` Jonathan Woithe
  -1 siblings, 0 replies; 88+ messages in thread
From: Jonathan Woithe @ 2013-12-31 13:05 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, Matthew Garrett, platform-driver-x86,
	linux-kernel, jwoithe

On Sun, Dec 29, 2013 at 11:47:36PM +0100, Julia Lawall wrote:
> These functions mix the use of result and error.  In acpi_fujitsu_add,
> result does not seem useful; it would seem reasonable to propagate the
> return value of acpi_bus_update_power in an error case.

Agreed.

> On the other hand, in the case of acpi_fujitsu_hotkey_add, there is an
> initialization of result that can lead to what looks like a failure case,
> but that does not abort the function.  The variable result is kept for
> this case.

The handling of result in acpi_fujitsu_hotkey_add() applies to machines
which I don't have physical access to - the code was contributed by others. 
My understanding is that on these machines the failure of the LED class
registration is not necessarily grounds for aborting the function
immediately.  That said, the change made to acpi_fujitsu_hotkey_add() in
this patch look correct to me: the err_stop label should be returning
"error", and consequently the acpi_bus_update_power() return should be saved
to "error".

Acked-off-by: Jonathan Woithe <jwoithe@just42.net>

> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
> Not tested.  Not sure to be doing the right thing with result in the second
> case.
> 
>  drivers/platform/x86/fujitsu-laptop.c |   15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
> index 9d30d69..be02bcc 100644
> --- a/drivers/platform/x86/fujitsu-laptop.c
> +++ b/drivers/platform/x86/fujitsu-laptop.c
> @@ -633,7 +633,6 @@ static struct dmi_system_id fujitsu_dmi_table[] = {
>  
>  static int acpi_fujitsu_add(struct acpi_device *device)
>  {
> -	int result = 0;
>  	int state = 0;
>  	struct input_dev *input;
>  	int error;
> @@ -669,8 +668,8 @@ static int acpi_fujitsu_add(struct acpi_device *device)
>  	if (error)
>  		goto err_free_input_dev;
>  
> -	result = acpi_bus_update_power(fujitsu->acpi_handle, &state);
> -	if (result) {
> +	error = acpi_bus_update_power(fujitsu->acpi_handle, &state);
> +	if (error) {
>  		pr_err("Error reading power state\n");
>  		goto err_unregister_input_dev;
>  	}
> @@ -700,7 +699,7 @@ static int acpi_fujitsu_add(struct acpi_device *device)
>  		fujitsu->max_brightness = FUJITSU_LCD_N_LEVELS;
>  	get_lcd_level();
>  
> -	return result;
> +	return 0;
>  
>  err_unregister_input_dev:
>  	input_unregister_device(input);
> @@ -708,7 +707,7 @@ err_unregister_input_dev:
>  err_free_input_dev:
>  	input_free_device(input);
>  err_stop:
> -	return result;
> +	return error;
>  }
>  
>  static int acpi_fujitsu_remove(struct acpi_device *device)
> @@ -831,8 +830,8 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
>  	if (error)
>  		goto err_free_input_dev;
>  
> -	result = acpi_bus_update_power(fujitsu_hotkey->acpi_handle, &state);
> -	if (result) {
> +	error = acpi_bus_update_power(fujitsu_hotkey->acpi_handle, &state);
> +	if (error) {
>  		pr_err("Error reading power state\n");
>  		goto err_unregister_input_dev;
>  	}
> @@ -907,7 +906,7 @@ err_free_input_dev:
>  err_free_fifo:
>  	kfifo_free(&fujitsu_hotkey->fifo);
>  err_stop:
> -	return result;
> +	return error;
>  }
>  
>  static int acpi_fujitsu_hotkey_remove(struct acpi_device *device)
> 
> --

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

* Re: [PATCH 21/25] fujitsu-laptop: fix error return code
@ 2013-12-31 13:17     ` Jonathan Woithe
  0 siblings, 0 replies; 88+ messages in thread
From: Jonathan Woithe @ 2013-12-31 13:17 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, Matthew Garrett, platform-driver-x86,
	linux-kernel, jwoithe

On Sun, Dec 29, 2013 at 11:47:36PM +0100, Julia Lawall wrote:
> These functions mix the use of result and error.  In acpi_fujitsu_add,
> result does not seem useful; it would seem reasonable to propagate the
> return value of acpi_bus_update_power in an error case.

Agreed.

> On the other hand, in the case of acpi_fujitsu_hotkey_add, there is an
> initialization of result that can lead to what looks like a failure case,
> but that does not abort the function.  The variable result is kept for
> this case.

The handling of result in acpi_fujitsu_hotkey_add() applies to machines
which I don't have physical access to - the code was contributed by others. 
My understanding is that on these machines the failure of the LED class
registration is not necessarily grounds for aborting the function
immediately.  That said, the change made to acpi_fujitsu_hotkey_add() in
this patch look correct to me: the err_stop label should be returning
"error", and consequently the acpi_bus_update_power() return should be saved
to "error".

Acked-off-by: Jonathan Woithe <jwoithe@just42.net>

> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
> Not tested.  Not sure to be doing the right thing with result in the second
> case.
> 
>  drivers/platform/x86/fujitsu-laptop.c |   15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
> index 9d30d69..be02bcc 100644
> --- a/drivers/platform/x86/fujitsu-laptop.c
> +++ b/drivers/platform/x86/fujitsu-laptop.c
> @@ -633,7 +633,6 @@ static struct dmi_system_id fujitsu_dmi_table[] = {
>  
>  static int acpi_fujitsu_add(struct acpi_device *device)
>  {
> -	int result = 0;
>  	int state = 0;
>  	struct input_dev *input;
>  	int error;
> @@ -669,8 +668,8 @@ static int acpi_fujitsu_add(struct acpi_device *device)
>  	if (error)
>  		goto err_free_input_dev;
>  
> -	result = acpi_bus_update_power(fujitsu->acpi_handle, &state);
> -	if (result) {
> +	error = acpi_bus_update_power(fujitsu->acpi_handle, &state);
> +	if (error) {
>  		pr_err("Error reading power state\n");
>  		goto err_unregister_input_dev;
>  	}
> @@ -700,7 +699,7 @@ static int acpi_fujitsu_add(struct acpi_device *device)
>  		fujitsu->max_brightness = FUJITSU_LCD_N_LEVELS;
>  	get_lcd_level();
>  
> -	return result;
> +	return 0;
>  
>  err_unregister_input_dev:
>  	input_unregister_device(input);
> @@ -708,7 +707,7 @@ err_unregister_input_dev:
>  err_free_input_dev:
>  	input_free_device(input);
>  err_stop:
> -	return result;
> +	return error;
>  }
>  
>  static int acpi_fujitsu_remove(struct acpi_device *device)
> @@ -831,8 +830,8 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
>  	if (error)
>  		goto err_free_input_dev;
>  
> -	result = acpi_bus_update_power(fujitsu_hotkey->acpi_handle, &state);
> -	if (result) {
> +	error = acpi_bus_update_power(fujitsu_hotkey->acpi_handle, &state);
> +	if (error) {
>  		pr_err("Error reading power state\n");
>  		goto err_unregister_input_dev;
>  	}
> @@ -907,7 +906,7 @@ err_free_input_dev:
>  err_free_fifo:
>  	kfifo_free(&fujitsu_hotkey->fifo);
>  err_stop:
> -	return result;
> +	return error;
>  }
>  
>  static int acpi_fujitsu_hotkey_remove(struct acpi_device *device)
> 
> --

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

* Re: [PATCH 23/25] thermal: exynos: fix error return code
  2013-12-29 22:47   ` Julia Lawall
  (?)
@ 2014-01-02  1:55     ` Zhang Rui
  -1 siblings, 0 replies; 88+ messages in thread
From: Zhang Rui @ 2014-01-02  1:55 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, Eduardo Valentin, Kukjin Kim, linux-pm,
	linux-arm-kernel, linux-samsung-soc, linux-kernel

On Sun, 2013-12-29 at 23:47 +0100, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Set the return variable to an error code as done elsewhere in the function.
> 
> 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,
rui
> 
> ---
> Not tested.
> 
>  drivers/thermal/samsung/exynos_tmu.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index 32f38b9..0d96a51 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -205,6 +205,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
>  skip_calib_data:
>  	if (pdata->max_trigger_level > MAX_THRESHOLD_LEVS) {
>  		dev_err(&pdev->dev, "Invalid max trigger level\n");
> +		ret = -EINVAL;
>  		goto out;
>  	}
>  
> 



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

* Re: [PATCH 23/25] thermal: exynos: fix error return code
@ 2014-01-02  1:55     ` Zhang Rui
  0 siblings, 0 replies; 88+ messages in thread
From: Zhang Rui @ 2014-01-02  1:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, 2013-12-29 at 23:47 +0100, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Set the return variable to an error code as done elsewhere in the function.
> 
> 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,
rui
> 
> ---
> Not tested.
> 
>  drivers/thermal/samsung/exynos_tmu.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index 32f38b9..0d96a51 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -205,6 +205,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
>  skip_calib_data:
>  	if (pdata->max_trigger_level > MAX_THRESHOLD_LEVS) {
>  		dev_err(&pdev->dev, "Invalid max trigger level\n");
> +		ret = -EINVAL;
>  		goto out;
>  	}
>  
> 



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

* [PATCH 23/25] thermal: exynos: fix error return code
@ 2014-01-02  1:55     ` Zhang Rui
  0 siblings, 0 replies; 88+ messages in thread
From: Zhang Rui @ 2014-01-02  1:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, 2013-12-29 at 23:47 +0100, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Set the return variable to an error code as done elsewhere in the function.
> 
> 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>

applied.

thanks,
rui
> 
> ---
> Not tested.
> 
>  drivers/thermal/samsung/exynos_tmu.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index 32f38b9..0d96a51 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -205,6 +205,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
>  skip_calib_data:
>  	if (pdata->max_trigger_level > MAX_THRESHOLD_LEVS) {
>  		dev_err(&pdev->dev, "Invalid max trigger level\n");
> +		ret = -EINVAL;
>  		goto out;
>  	}
>  
> 

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

* Re: [PATCH 13/25] hamradio: 6pack: fix error return code
  2013-12-29 22:47   ` Julia Lawall
@ 2014-01-02  8:31     ` David Miller
  -1 siblings, 0 replies; 88+ messages in thread
From: David Miller @ 2014-01-02  8:31 UTC (permalink / raw)
  To: Julia.Lawall; +Cc: ajk, linux-hams, netdev, kernel-janitors, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 29 Dec 2013 23:47:28 +0100

> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Set the return variable to an error code as done elsewhere in the function.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
 ...
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied.

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

* Re: [PATCH 13/25] hamradio: 6pack: fix error return code
@ 2014-01-02  8:31     ` David Miller
  0 siblings, 0 replies; 88+ messages in thread
From: David Miller @ 2014-01-02  8:31 UTC (permalink / raw)
  To: Julia.Lawall; +Cc: ajk, linux-hams, netdev, kernel-janitors, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 29 Dec 2013 23:47:28 +0100

> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Set the return variable to an error code as done elsewhere in the function.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
 ...
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied.

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

* Re: [PATCH 7/25] net: fix error return code
  2013-12-29 22:47   ` Julia Lawall
@ 2014-01-02  8:31     ` David Miller
  -1 siblings, 0 replies; 88+ messages in thread
From: David Miller @ 2014-01-02  8:31 UTC (permalink / raw)
  To: Julia.Lawall; +Cc: geoff, kernel-janitors, netdev, cbe-oss-dev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 29 Dec 2013 23:47:22 +0100

> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Set the return variable to propagate any error code as done elsewhere in
> the function.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
...
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied.

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

* Re: [PATCH 7/25] net: fix error return code
@ 2014-01-02  8:31     ` David Miller
  0 siblings, 0 replies; 88+ messages in thread
From: David Miller @ 2014-01-02  8:31 UTC (permalink / raw)
  To: Julia.Lawall; +Cc: geoff, kernel-janitors, netdev, cbe-oss-dev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 29 Dec 2013 23:47:22 +0100

> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Set the return variable to propagate any error code as done elsewhere in
> the function.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
...
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied.

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

* Re: [PATCH 12/25] HID: sony: fix error return code
  2013-12-29 22:47   ` Julia Lawall
@ 2014-01-02 12:51     ` Jiri Kosina
  -1 siblings, 0 replies; 88+ messages in thread
From: Jiri Kosina @ 2014-01-02 12:51 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, linux-input, linux-kernel

On Sun, 29 Dec 2013, Julia Lawall wrote:

> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Currently the return variable ret is always 0.  Set it to other values in
> error cases, as used in the direct return.
> 
> 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.

-- 
Jiri Kosina
SUSE Labs

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

* Re: [PATCH 12/25] HID: sony: fix error return code
@ 2014-01-02 12:51     ` Jiri Kosina
  0 siblings, 0 replies; 88+ messages in thread
From: Jiri Kosina @ 2014-01-02 12:51 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, linux-input, linux-kernel

On Sun, 29 Dec 2013, Julia Lawall wrote:

> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Currently the return variable ret is always 0.  Set it to other values in
> error cases, as used in the direct return.
> 
> 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.

-- 
Jiri Kosina
SUSE Labs

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

* Re: [PATCH 4/25] UBI: fix error return code
  2013-12-29 22:47   ` Julia Lawall
  (?)
@ 2014-01-02 15:16     ` Artem Bityutskiy
  -1 siblings, 0 replies; 88+ messages in thread
From: Artem Bityutskiy @ 2014-01-02 15:16 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, David Woodhouse, Brian Norris, linux-mtd, linux-kernel

On Sun, 2013-12-29 at 23:47 +0100, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Set the return variable to an error code as done elsewhere in the function.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)

Pushed to linux-ubifs.git, thanks!

-- 
Best Regards,
Artem Bityutskiy


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

* Re: [PATCH 4/25] UBI: fix error return code
@ 2014-01-02 15:16     ` Artem Bityutskiy
  0 siblings, 0 replies; 88+ messages in thread
From: Artem Bityutskiy @ 2014-01-02 15:16 UTC (permalink / raw)
  To: Julia Lawall
  Cc: David Woodhouse, Brian Norris, kernel-janitors, linux-kernel, linux-mtd

On Sun, 2013-12-29 at 23:47 +0100, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Set the return variable to an error code as done elsewhere in the function.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)

Pushed to linux-ubifs.git, thanks!

-- 
Best Regards,
Artem Bityutskiy


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

* Re: [PATCH 4/25] UBI: fix error return code
@ 2014-01-02 15:16     ` Artem Bityutskiy
  0 siblings, 0 replies; 88+ messages in thread
From: Artem Bityutskiy @ 2014-01-02 15:16 UTC (permalink / raw)
  To: Julia Lawall
  Cc: David Woodhouse, Brian Norris, kernel-janitors, linux-kernel, linux-mtd

On Sun, 2013-12-29 at 23:47 +0100, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Set the return variable to an error code as done elsewhere in the function.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)

Pushed to linux-ubifs.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

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

* Re: [PATCH 6/25]  fix error return code
  2013-12-29 22:47   ` Julia Lawall
@ 2014-01-03  9:08     ` Jiri Kosina
  -1 siblings, 0 replies; 88+ messages in thread
From: Jiri Kosina @ 2014-01-03  9:08 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, linux-kernel

On Sun, 29 Dec 2013, Julia Lawall wrote:

> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Set the return variable to an error code as done elsewhere in the function.
> 
> 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.

-- 
Jiri Kosina
SUSE Labs

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

* Re: [PATCH 6/25]  fix error return code
@ 2014-01-03  9:08     ` Jiri Kosina
  0 siblings, 0 replies; 88+ messages in thread
From: Jiri Kosina @ 2014-01-03  9:08 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, linux-kernel

On Sun, 29 Dec 2013, Julia Lawall wrote:

> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Set the return variable to an error code as done elsewhere in the function.
> 
> 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.

-- 
Jiri Kosina
SUSE Labs

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

* Re: [PATCH 8/25] drivers/dma: fix error return code
  2013-12-29 22:47   ` Julia Lawall
@ 2014-01-20  9:40     ` Vinod Koul
  -1 siblings, 0 replies; 88+ messages in thread
From: Vinod Koul @ 2014-01-20  9:28 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, Dan Williams, dmaengine, linux-kernel

On Sun, Dec 29, 2013 at 11:47:23PM +0100, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Set the return variable to an error code as done elsewhere in the function.
> 
> 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

--
~Vinod
> 
> ---
> Not tested.
> 
>  drivers/dma/cppi41.c      |    4 +++-
>  drivers/dma/ppc4xx/adma.c |    1 +
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c
> index c29dacf..c18aebf 100644
> --- a/drivers/dma/cppi41.c
> +++ b/drivers/dma/cppi41.c
> @@ -972,8 +972,10 @@ static int cppi41_dma_probe(struct platform_device *pdev)
>  		goto err_chans;
>  
>  	irq = irq_of_parse_and_map(dev->of_node, 0);
> -	if (!irq)
> +	if (!irq) {
> +		ret = -EINVAL;
>  		goto err_irq;
> +	}
>  
>  	cppi_writel(USBSS_IRQ_PD_COMP, cdd->usbss_mem + USBSS_IRQ_ENABLER);
>  
> diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c
> index 8bba298..ce7a8d7 100644
> --- a/drivers/dma/ppc4xx/adma.c
> +++ b/drivers/dma/ppc4xx/adma.c
> @@ -4114,6 +4114,7 @@ static int ppc440spe_adma_probe(struct platform_device *ofdev)
>  	regs = ioremap(res.start, resource_size(&res));
>  	if (!regs) {
>  		dev_err(&ofdev->dev, "failed to ioremap regs!\n");
> +		ret = -ENOMEM;
>  		goto err_regs_alloc;
>  	}
>  
> 

-- 

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

* Re: [PATCH 8/25] drivers/dma: fix error return code
@ 2014-01-20  9:40     ` Vinod Koul
  0 siblings, 0 replies; 88+ messages in thread
From: Vinod Koul @ 2014-01-20  9:40 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, Dan Williams, dmaengine, linux-kernel

On Sun, Dec 29, 2013 at 11:47:23PM +0100, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Set the return variable to an error code as done elsewhere in the function.
> 
> 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

--
~Vinod
> 
> ---
> Not tested.
> 
>  drivers/dma/cppi41.c      |    4 +++-
>  drivers/dma/ppc4xx/adma.c |    1 +
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c
> index c29dacf..c18aebf 100644
> --- a/drivers/dma/cppi41.c
> +++ b/drivers/dma/cppi41.c
> @@ -972,8 +972,10 @@ static int cppi41_dma_probe(struct platform_device *pdev)
>  		goto err_chans;
>  
>  	irq = irq_of_parse_and_map(dev->of_node, 0);
> -	if (!irq)
> +	if (!irq) {
> +		ret = -EINVAL;
>  		goto err_irq;
> +	}
>  
>  	cppi_writel(USBSS_IRQ_PD_COMP, cdd->usbss_mem + USBSS_IRQ_ENABLER);
>  
> diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c
> index 8bba298..ce7a8d7 100644
> --- a/drivers/dma/ppc4xx/adma.c
> +++ b/drivers/dma/ppc4xx/adma.c
> @@ -4114,6 +4114,7 @@ static int ppc440spe_adma_probe(struct platform_device *ofdev)
>  	regs = ioremap(res.start, resource_size(&res));
>  	if (!regs) {
>  		dev_err(&ofdev->dev, "failed to ioremap regs!\n");
> +		ret = -ENOMEM;
>  		goto err_regs_alloc;
>  	}
>  
> 

-- 

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

end of thread, other threads:[~2014-01-20 10:30 UTC | newest]

Thread overview: 88+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-29 21:58 [PATCH 0/25] fix error return code Julia Lawall
2013-12-29 22:47 ` Julia Lawall
2013-12-29 22:47 ` Julia Lawall
2013-12-29 22:47 ` Julia Lawall
2013-12-29 22:47 ` Julia Lawall
2013-12-29 22:47 ` Julia Lawall
2013-12-29 21:52 ` [PATCH 23/25] thermal: exynos: " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-30  1:31   ` Jingoo Han
2013-12-30  1:31     ` Jingoo Han
2013-12-30  1:31     ` Jingoo Han
2014-01-02  1:55   ` Zhang Rui
2014-01-02  1:55     ` Zhang Rui
2014-01-02  1:55     ` Zhang Rui
2013-12-29 21:53 ` [PATCH 21/25] fujitsu-laptop: " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-31 13:05   ` Jonathan Woithe
2013-12-31 13:17     ` Jonathan Woithe
2013-12-29 21:53 ` [PATCH 20/25] " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-29 21:53 ` [PATCH 15/25] " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-29 21:54 ` [PATCH 13/25] hamradio: 6pack: " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2014-01-02  8:31   ` David Miller
2014-01-02  8:31     ` David Miller
2013-12-29 21:54 ` [PATCH 24/25] " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-29 21:54 ` [PATCH 22/25] RDMA/nes: " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-29 21:54 ` [PATCH 14/25] RDMA/amso1100: " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-29 21:54 ` [PATCH 9/25] " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-29 21:55 ` [PATCH 19/25] " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-29 21:58   ` Geert Uytterhoeven
2013-12-29 21:58     ` Geert Uytterhoeven
2013-12-29 21:58     ` Geert Uytterhoeven
2013-12-29 21:55 ` [PATCH 11/25] pcmcia: " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-29 21:55 ` [PATCH 12/25] HID: sony: " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2014-01-02 12:51   ` Jiri Kosina
2014-01-02 12:51     ` Jiri Kosina
2013-12-29 21:56 ` [PATCH 10/25] usb: gadget: " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-29 21:56 ` [PATCH 18/25] mtd: nand: " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-29 21:56 ` [PATCH 16/25] block: " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-29 21:57 ` [PATCH 17/25] " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-29 21:57 ` [PATCH 6/25] " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2014-01-03  9:08   ` Jiri Kosina
2014-01-03  9:08     ` Jiri Kosina
2013-12-29 21:57 ` [PATCH 8/25] drivers/dma: " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2014-01-20  9:28   ` Vinod Koul
2014-01-20  9:40     ` Vinod Koul
2013-12-29 21:59 ` [PATCH 7/25] net: " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2014-01-02  8:31   ` David Miller
2014-01-02  8:31     ` David Miller
2013-12-29 21:59 ` [PATCH 5/25] IB/mlx4: " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
     [not found]   ` <1388357260-4843-6-git-send-email-Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
2013-12-31  7:52     ` Jack Morgenstein
2013-12-31  7:52       ` Jack Morgenstein
2013-12-31  7:52       ` Jack Morgenstein
2013-12-29 21:59 ` [PATCH 3/25] " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-29 21:59 ` [PATCH 4/25] UBI: " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-31 11:30   ` Richard Weinberger
2013-12-31 11:30     ` Richard Weinberger
2013-12-31 11:30     ` Richard Weinberger
2014-01-02 15:16   ` Artem Bityutskiy
2014-01-02 15:16     ` Artem Bityutskiy
2014-01-02 15:16     ` Artem Bityutskiy
2013-12-29 22:00 ` [PATCH 2/25] rsxx: " Julia Lawall
2013-12-29 22:47   ` Julia Lawall
2013-12-29 22:00 ` [PATCH 1/25] " Julia Lawall
2013-12-29 22:47   ` Julia Lawall

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.