From: Dan Carpenter Date: Sat, 15 Apr 2017 18:55:51 +0000 (+0200) Subject: lightnvm: pblk-gc: fix an error pointer dereference in init X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=503ec94eca4f49c0a18d67bb60445fe998a601ae;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe --- 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; }