Skip to content

Commit

Permalink
KEYS: fix error return code in big_key_instantiate()
Browse files Browse the repository at this point in the history
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David Howells <dhowells@redhat.com>
  • Loading branch information
Wei Yongjun authored and David Howells committed Oct 30, 2013
1 parent 034faeb commit d2b8697
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion security/keys/big_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
file = shmem_file_setup("", datalen, 0);
if (IS_ERR(file))
if (IS_ERR(file)) {
ret = PTR_ERR(file);
goto err_quota;
}

written = kernel_write(file, prep->data, prep->datalen, 0);
if (written != datalen) {
Expand Down

0 comments on commit d2b8697

Please sign in to comment.