Commit d2b86970 authored by Wei Yongjun's avatar Wei Yongjun Committed by David Howells

KEYS: fix error return code in big_key_instantiate()

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 034faeb9
...@@ -71,8 +71,10 @@ int big_key_instantiate(struct key *key, struct key_preparsed_payload *prep) ...@@ -71,8 +71,10 @@ int big_key_instantiate(struct key *key, struct key_preparsed_payload *prep)
* TODO: Encrypt the stored data with a temporary key. * TODO: Encrypt the stored data with a temporary key.
*/ */
file = shmem_file_setup("", datalen, 0); file = shmem_file_setup("", datalen, 0);
if (IS_ERR(file)) if (IS_ERR(file)) {
ret = PTR_ERR(file);
goto err_quota; goto err_quota;
}
written = kernel_write(file, prep->data, prep->datalen, 0); written = kernel_write(file, prep->data, prep->datalen, 0);
if (written != datalen) { if (written != datalen) {
......
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