Commit 8c9ff1ad authored by Colin Ian King's avatar Colin Ian King Committed by Jens Axboe

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: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 75ba4ada
...@@ -4401,11 +4401,11 @@ static int bfq_get_rq_private(struct request_queue *q, struct request *rq, ...@@ -4401,11 +4401,11 @@ static int bfq_get_rq_private(struct request_queue *q, struct request *rq,
spin_lock_irq(&bfqd->lock); spin_lock_irq(&bfqd->lock);
bfq_check_ioprio_change(bic, bio);
if (!bic) if (!bic)
goto queue_fail; goto queue_fail;
bfq_check_ioprio_change(bic, bio);
bfq_bic_update_cgroup(bic, bio); bfq_bic_update_cgroup(bic, bio);
bfqq = bfq_get_bfqq_handle_split(bfqd, bic, bio, false, is_sync, bfqq = bfq_get_bfqq_handle_split(bfqd, bic, bio, false, is_sync,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment