diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-03-22 12:01:45 +0300 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@free-electrons.com> | 2017-03-23 12:44:02 +0300 |
commit | 4ca8c1d4979cc60cc129318ce0a89d075c9eb49f (patch) | |
tree | 462522111b8ca8bcbc866847ada384c46ccccfe3 | |
parent | 44dd182861f99f04171256f29b9dc51940757e5d (diff) | |
download | linux-4ca8c1d4979cc60cc129318ce0a89d075c9eb49f.tar.xz |
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 <dan.carpenter@oracle.com>
Reviewed-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
-rw-r--r-- | drivers/mtd/nand/nand_hynix.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/nand/nand_hynix.c b/drivers/mtd/nand/nand_hynix.c index 2a5d0efea498..b12dc7325378 100644 --- a/drivers/mtd/nand/nand_hynix.c +++ b/drivers/mtd/nand/nand_hynix.c @@ -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++) { |