]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - block/elevator.c
block: bvec_nr_vecs() returns value for wrong slab
[mirror_ubuntu-bionic-kernel.git] / block / elevator.c
index 7bda083d59684177bb66eec2e221177417c893ac..fbe2212761126abe85543f15b7f2286ed65b883c 100644 (file)
@@ -1079,8 +1079,11 @@ static int __elevator_change(struct request_queue *q, const char *name)
        /*
         * Special case for mq, turn off scheduling
         */
-       if (q->mq_ops && !strncmp(name, "none", 4))
+       if (q->mq_ops && !strncmp(name, "none", 4)) {
+               if (!q->elevator)
+                       return 0;
                return elevator_switch(q, NULL);
+       }
 
        strlcpy(elevator_name, name, sizeof(elevator_name));
        e = elevator_get(q, strstrip(elevator_name), true);