Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d374394 authored by Brian Norris's avatar Brian Norris
Browse files

mtd: nand: docg4: simplify error case



Other refactorings have left the 'fail' label much simpler, so it
shouldn't have to handle the failed allocation case.

This also fixes a -Wshadow warning.

Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent 7208b997
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -1354,13 +1354,9 @@ static int __init probe_docg4(struct platform_device *pdev)
	return 0;

fail:
	if (nand) {
		/* re-declarations avoid compiler warning */
		struct docg4_priv *doc = nand->priv;
	nand_release(mtd); /* deletes partitions and mtd devices */
	free_bch(doc->bch);
	kfree(nand);
	}

fail_unmap:
	iounmap(virtadr);