Explorar o código

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>
Christophe JAILLET %!s(int64=8) %!d(string=hai) anos
pai
achega
654a01b788
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      drivers/lightnvm/rrpc.c

+ 4 - 2
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);
 	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++) {
 	for (i = 0; i < nr_blks; i++) {
 		if (blks[i] == NVM_BLK_T_FREE)
 		if (blks[i] == NVM_BLK_T_FREE)