diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-03-30 01:05:23 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-03-30 02:29:09 +0300 |
commit | 5565b0ca50b5b82e0439f6e4dc7fbb122cd0b025 (patch) | |
tree | 9f925c9829dbf3c234249e9e448ed7523b066899 /drivers/lightnvm | |
parent | 9156f360a77f9b975645a66af5ae8f7f68eccded (diff) | |
download | linux-5565b0ca50b5b82e0439f6e4dc7fbb122cd0b025.tar.xz |
lightnvm: pblk: remove some unnecessary NULL checks
Smatch complains that flush_workqueue() dereferences the work queue
pointer but then we check if it's NULL on the next line when it's too
late. These NULL checks can be removed because the module won't load if
we can't allocate the work queues.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm')
-rw-r--r-- | drivers/lightnvm/pblk-gc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/lightnvm/pblk-gc.c b/drivers/lightnvm/pblk-gc.c index 7143b0f740fb..6851a5c67189 100644 --- a/drivers/lightnvm/pblk-gc.c +++ b/drivers/lightnvm/pblk-gc.c @@ -664,12 +664,10 @@ void pblk_gc_exit(struct pblk *pblk) kthread_stop(gc->gc_reader_ts); flush_workqueue(gc->gc_reader_wq); - if (gc->gc_reader_wq) - destroy_workqueue(gc->gc_reader_wq); + destroy_workqueue(gc->gc_reader_wq); flush_workqueue(gc->gc_line_reader_wq); - if (gc->gc_line_reader_wq) - destroy_workqueue(gc->gc_line_reader_wq); + destroy_workqueue(gc->gc_line_reader_wq); if (gc->gc_writer_ts) kthread_stop(gc->gc_writer_ts); |