]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
lightnvm: Fix error handling
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 15 Apr 2017 18:55:35 +0000 (20:55 +0200)
committerJens Axboe <axboe@fb.com>
Sun, 16 Apr 2017 16:06:25 +0000 (10:06 -0600)
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>
drivers/lightnvm/rrpc.c

index e00b1d7b976f0e892c7ff27ce697e3eaeadd6481..e68efbcf11880c7d57286b597a252ff7767a6a35 100644 (file)
@@ -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)