summaryrefslogtreecommitdiffstats
path: root/block/bfq-iosched.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2017-04-20 10:07:18 -0400
committerJens Axboe <axboe@fb.com>2017-04-20 10:19:23 -0400
commit8c9ff1addad515037abc1b14684f9d6fd480c247 (patch)
tree9c4727a695f1f8f0e92fa5c94de94b1478fd318a /block/bfq-iosched.c
parent75ba4ada8286d415bcaab993ce1f11125b8aa13e (diff)
block, bfq: don't dereference bic before null checking it
The call to bfq_check_ioprio_change will dereference bic, however, the null check for bic is after this call. Move the the null check on bic to before the call to avoid any potential null pointer dereference issues. Detected by CoverityScan, CID#1430138 ("Dereference before null check") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/bfq-iosched.c')
-rw-r--r--block/bfq-iosched.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 6d14f18c0d45..bd8499ef157c 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -4401,11 +4401,11 @@ static int bfq_get_rq_private(struct request_queue *q, struct request *rq,
4401 4401
4402 spin_lock_irq(&bfqd->lock); 4402 spin_lock_irq(&bfqd->lock);
4403 4403
4404 bfq_check_ioprio_change(bic, bio);
4405
4406 if (!bic) 4404 if (!bic)
4407 goto queue_fail; 4405 goto queue_fail;
4408 4406
4407 bfq_check_ioprio_change(bic, bio);
4408
4409 bfq_bic_update_cgroup(bic, bio); 4409 bfq_bic_update_cgroup(bic, bio);
4410 4410
4411 bfqq = bfq_get_bfqq_handle_split(bfqd, bic, bio, false, is_sync, 4411 bfqq = bfq_get_bfqq_handle_split(bfqd, bic, bio, false, is_sync,