summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2017-04-15 20:55:35 +0200
committerJens Axboe <axboe@fb.com>2017-04-16 18:06:25 +0200
commit654a01b78846b96527263acb2fc373371c281896 (patch)
tree0ab613286584f2e811d5c290428cfd56325ad2d8
parentnet: off by one in inet6_pton() (diff)
downloadlinux-654a01b78846b96527263acb2fc373371c281896.tar.xz
linux-654a01b78846b96527263acb2fc373371c281896.zip
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>
-rw-r--r--drivers/lightnvm/rrpc.c6
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)