Merge tag 'rproc-v4.14' of git://github.com/andersson/remoteproc
[platform/kernel/linux-exynos.git] / block / elevator.c
index 4bb2f0c..153926a 100644 (file)
@@ -1055,6 +1055,10 @@ static int __elevator_change(struct request_queue *q, const char *name)
        char elevator_name[ELV_NAME_MAX];
        struct elevator_type *e;
 
+       /* Make sure queue is not in the middle of being removed */
+       if (!test_bit(QUEUE_FLAG_REGISTERED, &q->queue_flags))
+               return -ENOENT;
+
        /*
         * Special case for mq, turn off scheduling
         */