summaryrefslogtreecommitdiff
path: root/block/blk-sysfs.c
diff options
context:
space:
mode:
authorweiping zhang <zhangweiping@didichuxing.com>2017-11-23 21:39:40 +0800
committerJens Axboe <axboe@kernel.dk>2017-11-23 22:00:17 -0700
commitf680474345f1fd6329d1806d6358066fd3b07f02 (patch)
tree62b12f06dc8da3d906e24ea0ab6c5cf0d2f7dd43 /block/blk-sysfs.c
parent612ea091fc77770d659b82ea44a1d5646e0af54c (diff)
downloadlinux-rpi3-f680474345f1fd6329d1806d6358066fd3b07f02.tar.gz
linux-rpi3-f680474345f1fd6329d1806d6358066fd3b07f02.tar.bz2
linux-rpi3-f680474345f1fd6329d1806d6358066fd3b07f02.zip
blk-sysfs: remove NULL pointer checking in queue_wb_lat_store
wbt_init doesn't set q->rq_wb to NULL, if wbt_init return 0, so check return value is enough, remove NULL checking. Signed-off-by: weiping zhang <zhangweiping@didichuxing.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-sysfs.c')
-rw-r--r--block/blk-sysfs.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index e54be402899d..870484eaed1f 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -450,12 +450,9 @@ static ssize_t queue_wb_lat_store(struct request_queue *q, const char *page,
ret = wbt_init(q);
if (ret)
return ret;
-
- rwb = q->rq_wb;
- if (!rwb)
- return -EINVAL;
}
+ rwb = q->rq_wb;
if (val == -1)
rwb->min_lat_nsec = wbt_default_latency_nsec(q);
else if (val >= 0)