Commit c203f3b0 authored by Markus Elfring's avatar Markus Elfring Committed by David Howells

KEYS: Delete an error message for a failed memory allocation in get_derived_key()

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdfSigned-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 4df79702
...@@ -385,10 +385,9 @@ static int get_derived_key(u8 *derived_key, enum derived_key_type key_type, ...@@ -385,10 +385,9 @@ static int get_derived_key(u8 *derived_key, enum derived_key_type key_type,
derived_buf_len = HASH_SIZE; derived_buf_len = HASH_SIZE;
derived_buf = kzalloc(derived_buf_len, GFP_KERNEL); derived_buf = kzalloc(derived_buf_len, GFP_KERNEL);
if (!derived_buf) { if (!derived_buf)
pr_err("encrypted_key: out of memory\n");
return -ENOMEM; return -ENOMEM;
}
if (key_type) if (key_type)
strcpy(derived_buf, "AUTH_KEY"); strcpy(derived_buf, "AUTH_KEY");
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment