Commit:     0a0836a09ca7a27341703ef154c82e2e7f3e96f4
Parent:     abbeb88d00bef294ce661a9229c1dc31be064545
Author:     Oleg Nesterov <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 23 15:08:21 2007 +0200
Committer:  Jens Axboe <[EMAIL PROTECTED]>
CommitDate: Mon Oct 29 11:33:05 2007 +0100

    cfq_get_queue: fix possible NULL pointer access
    cfq_get_queue()->cfq_find_alloc_queue() can fail, check the returned value.
    Signed-off-by: Oleg Nesterov <[EMAIL PROTECTED]>
    Note that this isn't a bug at the moment, since the regular IO path
    does not call this path without __GFP_WAIT set. However, it could be a
    future bug, so I've applied it.
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
 block/cfq-iosched.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index d77c971..e47a930 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1443,8 +1443,11 @@ cfq_get_queue(struct cfq_data *cfqd, int is_sync, struct 
task_struct *tsk,
                cfqq = *async_cfqq;
-       if (!cfqq)
+       if (!cfqq) {
                cfqq = cfq_find_alloc_queue(cfqd, is_sync, tsk, gfp_mask);
+               if (!cfqq)
+                       return NULL;
+       }
         * pin the queue now that it's allocated, scheduler exit will prune it
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to