X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=block%2Fbfq-iosched.c;h=58e5c7cfa4ea6eb51aa5089c8b3f77793115721b;hb=4d84faf6cc9979b61181b022c34fd3b33dbcd017;hp=bcb6d21baf1269becc997c50a72bd53fd5e20c4c;hpb=bc686442f8a601bccac1f22506ecdb4b0d62cadd;p=mirror_ubuntu-bionic-kernel.git diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index bcb6d21baf12..58e5c7cfa4ea 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -4640,8 +4640,16 @@ static void bfq_prepare_request(struct request *rq, struct bio *bio) bool new_queue = false; bool bfqq_already_existing = false, split = false; - if (!rq->elv.icq) + /* + * Even if we don't have an icq attached, we should still clear + * the scheduler pointers, as they might point to previously + * allocated bic/bfqq structs. + */ + if (!rq->elv.icq) { + rq->elv.priv[0] = rq->elv.priv[1] = NULL; return; + } + bic = icq_to_bic(rq->elv.icq); spin_lock_irq(&bfqd->lock);