KEYS: fix error return code in big_key_instantiate()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 30 Oct 2013 03:23:02 +0000 (11:23 +0800)
committerDavid Howells <dhowells@redhat.com>
Wed, 30 Oct 2013 12:54:29 +0000 (12:54 +0000)
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>
security/keys/big_key.c

index 5f9defc4a807268544cf9378d27f453f5a43d82a..2cf5e62d67afdf849c6208d55adb79cc5db7b2a4 100644 (file)
@@ -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) {
This page took 0.026205 seconds and 5 git commands to generate.