public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] swim: Release memory region after incorrect return/goto
@ 2013-06-04 14:44 Joe Perches
  2013-06-04 14:44 ` [PATCH 2/4] inkern: iio_device_put " Joe Perches
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Joe Perches @ 2013-06-04 14:44 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: linux-kernel

The code uses

	return foo;
	goto err_type;

when instead the form should have been

	ret = foo;
	goto err_type;

Here this causes a useful release_mem_region to be skipped.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/block/swim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 2f445b7..8ed6ccb 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -893,7 +893,7 @@ static int swim_probe(struct platform_device *dev)
 
 	swim_base = ioremap(res->start, resource_size(res));
 	if (!swim_base) {
-		return -ENOMEM;
+		ret = -ENOMEM;
 		goto out_release_io;
 	}
 
-- 
1.8.1.2.459.gbcd45b4.dirty


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

end of thread, other threads:[~2013-06-04 18:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-04 14:44 [PATCH 1/4] swim: Release memory region after incorrect return/goto Joe Perches
2013-06-04 14:44 ` [PATCH 2/4] inkern: iio_device_put " Joe Perches
2013-06-04 17:28   ` Jonathan Cameron
2013-06-04 14:44 ` [PATCH 3/4] mtd: onenand: samsung: Release memory " Joe Perches
2013-06-04 14:44 ` [PATCH 4/4] cw1200: hwio: Remove an unnecessary goto Joe Perches
2013-06-04 15:09   ` Solomon Peachy
2013-06-04 18:25 ` [PATCH 1/4] swim: Release memory region after incorrect return/goto Laurent Vivier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox