Skip to content

Commit

Permalink
lightnvm: pblk-gc: fix an error pointer dereference in init
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Jens Axboe committed Apr 16, 2017
1 parent a4bd217 commit 503ec94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/lightnvm/pblk-gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 503ec94

Please sign in to comment.