Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f9d592be authored by Colin Ian King's avatar Colin Ian King Committed by Razziell
Browse files

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")

Change-Id: Ia6ef69d10d8a9ee644a0a4548e4388f9a953cd8c
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
Signed-off-by: default avatarFAROVITUS <farovitus@gmail.com>
Signed-off-by: default avatarAlbert I <krascgq@outlook.co.id>
parent 413de336
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -4566,6 +4566,8 @@ static int bfq_set_request(struct request_queue *q, struct request *rq,
	if (!bic)
		goto queue_fail;

	bfq_check_ioprio_change(bic, bio);

	bfq_bic_update_cgroup(bic, bio);

new_queue: