summaryrefslogtreecommitdiffstats
path: root/drivers/lightnvm
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-03-30 00:05:23 +0200
committerJens Axboe <axboe@kernel.dk>2018-03-29 17:29:09 -0600
commit5565b0ca50b5b82e0439f6e4dc7fbb122cd0b025 (patch)
tree9f925c9829dbf3c234249e9e448ed7523b066899 /drivers/lightnvm
parent9156f360a77f9b975645a66af5ae8f7f68eccded (diff)
downloadlinux-stable-5565b0ca50b5b82e0439f6e4dc7fbb122cd0b025.tar.gz
linux-stable-5565b0ca50b5b82e0439f6e4dc7fbb122cd0b025.tar.bz2
linux-stable-5565b0ca50b5b82e0439f6e4dc7fbb122cd0b025.zip
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.c6
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);