lkml.org 
[lkml]   [2012]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] cfq: fix NULL pointer dereference in cfq_choose_cfqg.
    Date
    I found null pointer dereferencing possibility while reviewing.
    If cfq_get_next_cfqg return null by RB_EMPTY_ROOT, null pointer dereferencing error can occur.

    Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
    ---
    block/cfq-iosched.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
    index d0ba505..d924272 100644
    --- a/block/cfq-iosched.c
    +++ b/block/cfq-iosched.c
    @@ -2306,7 +2306,7 @@ static void cfq_choose_cfqg(struct cfq_data *cfqd)
    cfqd->serving_group = cfqg;

    /* Restore the workload type data */
    - if (cfqg->saved_workload_slice) {
    + if (!cfqg && cfqg->saved_workload_slice) {
    cfqd->workload_expires = jiffies + cfqg->saved_workload_slice;
    cfqd->serving_type = cfqg->saved_workload;
    cfqd->serving_prio = cfqg->saved_serving_prio;
    --
    1.7.5.4


    \
     
     \ /
      Last update: 2012-03-04 13:13    [W:0.025 / U:66.108 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site