--- zzzz-none-000/linux-2.6.32.61/net/sched/act_gact.c 2013-06-10 09:43:48.000000000 +0000 +++ ar10-7272-687/linux-2.6.32.61/net/sched/act_gact.c 2011-05-25 13:51:48.000000000 +0000 @@ -67,9 +67,6 @@ struct tcf_common *pc; int ret = 0; int err; -#ifdef CONFIG_GACT_PROB - struct tc_gact_p *p_parm = NULL; -#endif if (nla == NULL) return -EINVAL; @@ -85,12 +82,6 @@ #ifndef CONFIG_GACT_PROB if (tb[TCA_GACT_PROB] != NULL) return -EOPNOTSUPP; -#else - if (tb[TCA_GACT_PROB]) { - p_parm = nla_data(tb[TCA_GACT_PROB]); - if (p_parm->ptype >= MAX_RAND) - return -EINVAL; - } #endif pc = tcf_hash_check(parm->index, a, bind, &gact_hash_info); @@ -112,7 +103,8 @@ spin_lock_bh(&gact->tcf_lock); gact->tcf_action = parm->action; #ifdef CONFIG_GACT_PROB - if (p_parm) { + if (tb[TCA_GACT_PROB] != NULL) { + struct tc_gact_p *p_parm = nla_data(tb[TCA_GACT_PROB]); gact->tcfg_paction = p_parm->paction; gact->tcfg_pval = p_parm->pval; gact->tcfg_ptype = p_parm->ptype; @@ -140,7 +132,7 @@ spin_lock(&gact->tcf_lock); #ifdef CONFIG_GACT_PROB - if (gact->tcfg_ptype) + if (gact->tcfg_ptype && gact_rand[gact->tcfg_ptype] != NULL) action = gact_rand[gact->tcfg_ptype](gact); else action = gact->tcf_action;