if (ax25_findbyuid(sax->sax25_uid)) 
user = ax25_findbyuid(sax->sax25_uid); if (user) { ax25_uid_put(user); 
int ax25_uid_ioctl(int cmd, struct sockaddr_ax25 *sax){	ax25_uid_assoc *s, *ax25_uid;	unsigned long res;	switch (cmd) {	case SIOCAX25GETUID:		res = -ENOENT;		read_lock(&ax25_uid_lock);		for (ax25_uid = ax25_uid_list; ax25_uid != NULL; ax25_uid = ax25_uid->next) {			if (ax25cmp(&sax->sax25_call, &ax25_uid->call) == 0) {				res = ax25_uid->uid;				break;			}		}		read_unlock(&ax25_uid_lock);		return res;	case SIOCAX25ADDUID:		if (!capable(CAP_NET_ADMIN))			return -EPERM;		if (ax25_findbyuid(sax->sax25_uid))			return -EEXIST;		if (sax->sax25_uid == 0)			return -EINVAL;		if ((ax25_uid = kmalloc(sizeof(*ax25_uid), GFP_KERNEL)) == NULL)			return -ENOMEM;		ax25_uid->uid  = sax->sax25_uid;		ax25_uid->call = sax->sax25_call;		write_lock(&ax25_uid_lock);		ax25_uid->next = ax25_uid_list;		ax25_uid_list  = ax25_uid;		write_unlock(&ax25_uid_lock);		return 0;	case SIOCAX25DELUID:		if (!capable(CAP_NET_ADMIN))			return -EPERM;		write_lock(&ax25_uid_lock);		for (ax25_uid = ax25_uid_list; ax25_uid != NULL; ax25_uid = ax25_uid->next) {			if (ax25cmp(&sax->sax25_call, &ax25_uid->call) == 0) {				break;			}		}		if (ax25_uid == NULL) {			write_unlock(&ax25_uid_lock);			return -ENOENT;		}		if ((s = ax25_uid_list) == ax25_uid) {			ax25_uid_list = s->next;			write_unlock(&ax25_uid_lock);			kfree(ax25_uid);			return 0;		}		while (s != NULL && s->next != NULL) {			if (s->next == ax25_uid) {				s->next = ax25_uid->next;				write_unlock(&ax25_uid_lock);				kfree(ax25_uid);				return 0;			}			s = s->next;		}		write_unlock(&ax25_uid_lock);		return -ENOENT;	default:		return -EINVAL;	}	return -EINVAL;	/*NOTREACHED */}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/01d7dd0e9f8c5f1888619d2649c7da389232b408/ax25_uid.c/clean/net/ax25/ax25_uid.c