> +struct nvme_dhchap_key *nvme_auth_alloc_key(u32 len, u8 hash)
> +{
> + struct nvme_dhchap_key *key = kzalloc(len + sizeof(*key), GFP_KERNEL);
This should use the struct_size() helper:
key = kzalloc(struct_size(key, key, len), GFP_KERNEL);
Otherwise the change looks good.