Skip to content

Commit

Permalink
swim: Release memory region after incorrect return/goto
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Laurent Vivier <Laurent@Vivier.EU>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
  • Loading branch information
Joe Perches authored and Geert Uytterhoeven committed Jun 24, 2013
1 parent 378f7ca commit 957d6bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/swim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 957d6bf

Please sign in to comment.