Merge branch android-common-3.10
[firefly-linux-kernel-4.4.55.git] / block / blk-cgroup.c
index b95219d2168d0957eb2a537c920cac531d7238d7..1ff8e97f853ad719ee13994f0d5fc3fafb76a775 100644 (file)
@@ -876,6 +876,13 @@ void blkcg_drain_queue(struct request_queue *q)
 {
        lockdep_assert_held(q->queue_lock);
 
+       /*
+        * @q could be exiting and already have destroyed all blkgs as
+        * indicated by NULL root_blkg.  If so, don't confuse policies.
+        */
+       if (!q->root_blkg)
+               return;
+
        /*
         * @q could be exiting and already have destroyed all blkgs as
         * indicated by NULL root_blkg.  If so, don't confuse policies.