if (last_mpc) kfree(last_mpc);  
kfree(last_mpc); 
static void wrandom_select_route(const struct flowi *flp,				 struct rtable *first,				 struct rtable **rp){	struct rtable *rt;	struct rtable *decision;	struct multipath_candidate *first_mpc = NULL;	struct multipath_candidate *mpc, *last_mpc = NULL;	int power = 0;	int last_power;	int selector;	const size_t size_mpc = sizeof(struct multipath_candidate);	/* collect all candidates and identify their weights */	for (rt = rcu_dereference(first); rt;	     rt = rcu_dereference(rt->u.rt_next)) {		if ((rt->u.dst.flags & DST_BALANCED) != 0 &&		    multipath_comparekeys(&rt->fl, flp)) {			struct multipath_candidate* mpc =				(struct multipath_candidate*)				kmalloc(size_mpc, GFP_ATOMIC);			if (!mpc)				return;			power += __multipath_lookup_weight(flp, rt) * 10000;			mpc->power = power;			mpc->rt = rt;			mpc->next = NULL;			if (!first_mpc)				first_mpc = mpc;			else				last_mpc->next = mpc;			last_mpc = mpc;		}	}	/* choose a weighted random candidate */	decision = first;	selector = random(power);	last_power = 0;	/* select candidate, adjust GC data and cleanup local state */	decision = first;	last_mpc = NULL;	for (mpc = first_mpc; mpc; mpc = mpc->next) {		mpc->rt->u.dst.lastuse = jiffies;		if (last_power <= selector && selector < mpc->power)			decision = mpc->rt;		last_power = mpc->power;		if (last_mpc)			kfree(last_mpc);		last_mpc = mpc;	}	if (last_mpc) {		/* concurrent __multipath_flush may lead to !last_mpc */		kfree(last_mpc);	}	decision->u.dst.__use++;	*rp = decision;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/a51482bde22f99c63fbbb57d5d46cc666384e379/multipath_wrandom.c/buggy/net/ipv4/multipath_wrandom.c