Message ID | 20170322090145.GA14520@mwanda |
---|---|
State | Accepted |
Commit | 4ca8c1d4979cc60cc129318ce0a89d075c9eb49f |
Delegated to: | Boris Brezillon |
Headers | show |
Am 22.03.2017 um 10:01 schrieb Dan Carpenter: > 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> > > 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++) { > Reviewed-by: Richard Weinberger <richard@nod.at> Thanks, //richard
On Wed, 22 Mar 2017 12:01:45 +0300 Dan Carpenter <dan.carpenter@oracle.com> wrote: > 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> Applied. Thanks, Boris > > 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++) {
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++) {
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>