diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2017-04-15 20:55:35 +0200 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-04-16 10:06:25 -0600 |
commit | 654a01b78846b96527263acb2fc373371c281896 (patch) | |
tree | 0ab613286584f2e811d5c290428cfd56325ad2d8 /drivers/lightnvm/rrpc.c | |
parent | a88086e09876f468356cfec5319ff62004e36a1b (diff) | |
download | linux-654a01b78846b96527263acb2fc373371c281896.tar.bz2 |
lightnvm: Fix error handling
According to error handling in this function, it is likely that going to
'out' was expected here.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Matias Bjørling <matias@cnexlabs.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/lightnvm/rrpc.c')
-rw-r--r-- | drivers/lightnvm/rrpc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index e00b1d7b976f..e68efbcf1188 100644 --- a/drivers/lightnvm/rrpc.c +++ b/drivers/lightnvm/rrpc.c @@ -1275,8 +1275,10 @@ static int rrpc_bb_discovery(struct nvm_tgt_dev *dev, struct rrpc_lun *rlun) } nr_blks = nvm_bb_tbl_fold(dev->parent, blks, nr_blks); - if (nr_blks < 0) - return nr_blks; + if (nr_blks < 0) { + ret = nr_blks; + goto out; + } for (i = 0; i < nr_blks; i++) { if (blks[i] == NVM_BLK_T_FREE) |