Commit 4ca8c1d4 authored by Dan Carpenter's avatar Dan Carpenter Committed by Boris Brezillon

mtd: nand: hynix: Fix an error code in init

We should be return -ENOMEM instead of success.

Fixes: 626994e0 ("mtd: nand: hynix: Add read-retry support for 1x nm MLC NANDs")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarRichard Weinberger <richard@nod.at>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent 44dd1828
...@@ -270,8 +270,10 @@ static int hynix_mlc_1xnm_rr_init(struct nand_chip *chip, ...@@ -270,8 +270,10 @@ static int hynix_mlc_1xnm_rr_init(struct nand_chip *chip,
goto out; goto out;
rr = kzalloc(sizeof(*rr) + (nregs * nmodes), GFP_KERNEL); rr = kzalloc(sizeof(*rr) + (nregs * nmodes), GFP_KERNEL);
if (!rr) if (!rr) {
ret = -ENOMEM;
goto out; goto out;
}
for (i = 0; i < nmodes; i++) { for (i = 0; i < nmodes; i++) {
for (j = 0; j < nregs; j++) { for (j = 0; j < nregs; j++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment