summaryrefslogtreecommitdiffstats
path: root/drivers/lightnvm
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-04-15 20:55:51 +0200
committerJens Axboe <axboe@fb.com>2017-04-16 10:06:34 -0600
commit503ec94eca4f49c0a18d67bb60445fe998a601ae (patch)
treed3a6a9678a54352ec12c22f35f9625f3b5a87fb8 /drivers/lightnvm
parenta4bd217b432685d6a177c28a2af187f041c473b7 (diff)
downloadlinux-503ec94eca4f49c0a18d67bb60445fe998a601ae.tar.bz2
lightnvm: pblk-gc: fix an error pointer dereference in init
These labels are reversed so we could end up dereferencing an error pointer or leaking. Fixes: 7f347ba6bb3a ("lightnvm: physical block device (pblk) target") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Matias Bjørling <matias@cnexlabs.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/lightnvm')
-rw-r--r--drivers/lightnvm/pblk-gc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/lightnvm/pblk-gc.c b/drivers/lightnvm/pblk-gc.c
index 9b147cfd8a41..f173fd4ea947 100644
--- a/drivers/lightnvm/pblk-gc.c
+++ b/drivers/lightnvm/pblk-gc.c
@@ -527,10 +527,10 @@ int pblk_gc_init(struct pblk *pblk)
return 0;
-fail_free_main_kthread:
- kthread_stop(gc->gc_ts);
fail_free_writer_kthread:
kthread_stop(gc->gc_writer_ts);
+fail_free_main_kthread:
+ kthread_stop(gc->gc_ts);
return ret;
}