Skip to contentSkip to conversation

swim: Release memory region after incorrect return/goto

PATCH In review Joe Perches 2 participants 2 messages Jun 4, 2013 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 swim: Release memory region after incorrect return/goto

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.

---

Hey Geert.

Just in case you don't see this on lkml.
I presume this has to go through you.

 drivers/block/swim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/swim.c +1 -1
index 2f445b7..8ed6ccb 100644
@@ -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 lore raw
Quoted 12 lines · Joe Perches

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.

Quoted 8 lines

---

Hey Geert.

Just in case you don't see this on lkml.
I presume this has to go through you.

Thanks, will apply and queue for 3.11.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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