mtd: nand: hynix: Fix an error code in init
Subsystems (3)
PATCH 1/1 mtd: nand: hynix: Fix an error code in init
We should be return -ENOMEM instead of success.
Fixes 626994e07480 ("mtd: nand: hynix: Add read-retry support for 1x nm MLC NANDs")
Signed-off-by Dan Carpenter <[email protected]>
drivers/mtd/nand/nand_hynix.c +3 -1
@@ -270,8 +270,10 @@ static int hynix_mlc_1xnm_rr_init(struct nand_chip *chip, goto out; rr =kzalloc (sizeof (*rr) + (nregs * nmodes),GFP_KERNEL ); -if (!rr) +if (!rr) { + ret = -ENOMEM ; goto out; + }for (i =0 ; i < nmodes; i++) {for (j =0 ; j < nregs; j++) {
Am 22.03.2017 um 10:01 schrieb Dan Carpenter:
Quoted 12 lines
We should be return
-ENOMEMinstead of success.Fixes 626994e07480 ("mtd: nand: hynix: Add read-retry support for 1x nm MLC NANDs")Signed-off-by Dan Carpenter <[email protected]>drivers/mtd/nand/nand_hynix.c +0
-0@@ -270,8 +270,10 @@ static int hynix_mlc_1xnm_rr_init(struct nand_chip *chip, goto out;
drivers/mtd/nand/nand_hynix.c static int hynix_mlc_1xnm_rr_init(struct nand_chip *chip, · line 279
Quoted 10 lines
drivers/mtd/nand/nand_hynix.c +3
-1rr =kzalloc (sizeof (*rr) + (nregs * nmodes),GFP_KERNEL ); -if (!rr) +if (!rr) { + ret = -ENOMEM ; goto out; + }for (i =0 ; i < nmodes; i++) {for (j =0 ; j < nregs; j++) {
Reviewed-by Richard Weinberger <[email protected]>
Thanks,
//richard
Boris Brezillon
AppliedQuoted 4 lines · On Wed, 22 Mar 2017 12:01:45 +0300 Dan Carpenter <[email protected]>…
We should be return
-ENOMEMinstead of success.Fixes 626994e07480 ("mtd: nand: hynix: Add read-retry support for 1x nm MLC NANDs")Signed-off-by Dan Carpenter <[email protected]>
Applied.
Thanks,
Boris
Quoted 17 lines
drivers/mtd/nand/nand_hynix.c +3
-1@@ -270,8 +270,10 @@ static int hynix_mlc_1xnm_rr_init(struct nand_chip *chip, goto out; rr =kzalloc (sizeof (*rr) + (nregs * nmodes),GFP_KERNEL ); -if (!rr) +if (!rr) { + ret = -ENOMEM ; goto out; + }for (i =0 ; i < nmodes; i++) {for (j =0 ; j < nregs; j++) {