Skip to content

Commit

Permalink
mtd: fsl_upm: fix a memory leak in fun_chip_init error path
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
  • Loading branch information
Axel Lin authored and Artem Bityutskiy committed Sep 11, 2011
1 parent 201ab53 commit a751d31
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/mtd/nand/fsl_upm.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ static int __devinit fun_chip_init(struct fsl_upm_nand *fun,
ret = mtd_device_parse_register(&fun->mtd, NULL, &ppdata, NULL, 0);
err:
of_node_put(flash_np);
if (ret)
kfree(fun->mtd.name);
return ret;
}

Expand Down

0 comments on commit a751d31

Please sign in to comment.