if (ax25_rt->digipeat != NULL) { kfree(ax25_rt->digipeat); ax25_rt->digipeat = NULL; } 
kfree(ax25_rt->digipeat); ax25_rt->digipeat = NULL; 
static int ax25_rt_add(struct ax25_routes_struct *route){	ax25_route *ax25_rt;	ax25_dev *ax25_dev;	int i;	if ((ax25_dev = ax25_addr_ax25dev(&route->port_addr)) == NULL)		return -EINVAL;	if (route->digi_count > AX25_MAX_DIGIS)		return -EINVAL;	write_lock(&ax25_route_lock);	ax25_rt = ax25_route_list;	while (ax25_rt != NULL) {		if (ax25cmp(&ax25_rt->callsign, &route->dest_addr) == 0 &&		            ax25_rt->dev == ax25_dev->dev) {			if (ax25_rt->digipeat != NULL) {				kfree(ax25_rt->digipeat);				ax25_rt->digipeat = NULL;			}			if (route->digi_count != 0) {				if ((ax25_rt->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) {					write_unlock(&ax25_route_lock);					return -ENOMEM;				}				ax25_rt->digipeat->lastrepeat = -1;				ax25_rt->digipeat->ndigi      = route->digi_count;				for (i = 0; i < route->digi_count; i++) {					ax25_rt->digipeat->repeated[i] = 0;					ax25_rt->digipeat->calls[i]    = route->digi_addr[i];				}			}			write_unlock(&ax25_route_lock);			return 0;		}		ax25_rt = ax25_rt->next;	}	if ((ax25_rt = kmalloc(sizeof(ax25_route), GFP_ATOMIC)) == NULL) {		write_unlock(&ax25_route_lock);		return -ENOMEM;	}	atomic_set(&ax25_rt->ref, 0);	ax25_rt->callsign     = route->dest_addr;	ax25_rt->dev          = ax25_dev->dev;	ax25_rt->digipeat     = NULL;	ax25_rt->ip_mode      = ' ';	if (route->digi_count != 0) {		if ((ax25_rt->digipeat = kmalloc(sizeof(ax25_digi), GFP_ATOMIC)) == NULL) {			write_unlock(&ax25_route_lock);			kfree(ax25_rt);			return -ENOMEM;		}		ax25_rt->digipeat->lastrepeat = -1;		ax25_rt->digipeat->ndigi      = route->digi_count;		for (i = 0; i < route->digi_count; i++) {			ax25_rt->digipeat->repeated[i] = 0;			ax25_rt->digipeat->calls[i]    = route->digi_addr[i];		}	}	ax25_rt->next   = ax25_route_list;	ax25_route_list = ax25_rt;	write_unlock(&ax25_route_lock);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/a51482bde22f99c63fbbb57d5d46cc666384e379/ax25_route.c/clean/net/ax25/ax25_route.c