Dave Jiang <[email protected]> wrote:

> +/*
> + * Find key in kernel keyring
> + */
> +static struct key *nvdimm_get_key(struct device *dev)

Note that the comment is no longer correct.

> +static struct key *nvdimm_request_key(struct device *dev)
> +{
> +     struct nvdimm *nvdimm = to_nvdimm(dev);
> +     struct key *key = NULL;
> +     char desc[NVDIMM_KEY_DESC_LEN + sizeof(NVDIMM_PREFIX)];
> +
> +     sprintf(desc, "%s%s", NVDIMM_PREFIX, nvdimm->dimm_id);
> +     key = request_key(&key_type_logon, desc, desc);

I would suggest passing "" as the callout_info rather than duplicating the
description.  The description is available to the upcall program anyway.

> +                     key_link(nvdimm_keyring, key);
> +                     nvdimm->key = key;

Since you're attaching the key to the nvdimm struct, do you actually need a
kernel keyring also?  You only ever link things into it and unlink things from
it; you never actually search it that I can see.  I would suggest, therefore,
just getting rid of the nvdimm_keyring entirely.  The keys are retained by the
nvdimm struct, so that shouldn't be a problem.

David
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to