/* install a session keyring, discarding the old one */
static int install_session_keyring(struct key *keyring)
/* install a session keyring, discarding the old one */
static int install_session_keyring(struct key *keyring)
{
	struct cred *new;
	int ret;
	new = prepare_creds();
	if (!new)
		return -ENOMEM;
	ret = install_session_keyring_to_cred(new, NULL);
	if (ret < 0) {
		abort_creds(new);
		return ret;
	}
	return commit_creds(new);
}