(PAGE_SIZE - sizeof(*klist)) / sizeof(struct key); 
(PAGE_SIZE - sizeof(*klist)) / sizeof(struct key *); 
static int keyring_duplicate(struct key *keyring, const struct key *source){	struct keyring_list *sklist, *klist;	unsigned max;	size_t size;	int loop, ret;	const unsigned limit =		(PAGE_SIZE - sizeof(*klist)) / sizeof(struct key);	ret = 0;	/* find out how many keys are currently linked */	rcu_read_lock();	sklist = rcu_dereference(source->payload.subscriptions);	max = 0;	if (sklist)		max = sklist->nkeys;	rcu_read_unlock();	/* allocate a new payload and stuff load with key links */	if (max > 0) {		BUG_ON(max > limit);		max = (max + 3) & ~3;		if (max > limit)			max = limit;		ret = -ENOMEM;		size = sizeof(*klist) + sizeof(struct key) * max;		klist = kmalloc(size, GFP_KERNEL);		if (!klist)			goto error;		/* set links */		rcu_read_lock();		sklist = rcu_dereference(source->payload.subscriptions);		klist->maxkeys = max;		klist->nkeys = sklist->nkeys;		memcpy(klist->keys,		       sklist->keys,		       sklist->nkeys * sizeof(struct key));		for (loop = klist->nkeys - 1; loop >= 0; loop--)			atomic_inc(&klist->keys[loop]->usage);		rcu_read_unlock();		rcu_assign_pointer(keyring->payload.subscriptions, klist);		ret = 0;	} error:	return ret;} /* end keyring_duplicate() */
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/a4014d8f61a6a136d22422cf8aa978e6495dbad9/keyring.c/buggy/security/keys/keyring.c