]> xenbits.xensource.com Git - people/aperard/linux-chromebook.git/commitdiff
BACKPORT: fs: ecryptfs: initialize payload_len in keystore.c
authorSimon Que <sque@chromium.org>
Thu, 17 Jan 2013 02:04:52 +0000 (18:04 -0800)
committerChromeBot <chrome-bot@google.com>
Fri, 18 Jan 2013 21:12:39 +0000 (13:12 -0800)
This is meant to remove a compiler warning.  It should not make any
functional change.

payload_len should be initialized when it is passed to
write_tag_64_packet() as a pointer.  If that call fails, this function
should return early, and payload_len won't be used.

The warning is:
fs/ecryptfs/keystore.c:1168:28: warning: 'payload_len' may be used
uninitialized in this function [-Wmaybe-uninitialized]

BUG=chromium-os:5542
TEST=emerge-x86-generic chromeos-kernel, this warning should not appear.

Change-Id: Ia4fb282b3b32eadecc7d2756c6a701864480618b
Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41580
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
fs/ecryptfs/keystore.c

index 2333203a120b3b853f71ef011a0755a3be04fd6a..6154cde3a052b7a233b1be06dc5b38667a846810 100644 (file)
@@ -1150,7 +1150,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok,
        struct ecryptfs_message *msg = NULL;
        char *auth_tok_sig;
        char *payload;
-       size_t payload_len;
+       size_t payload_len = 0;
        int rc;
 
        rc = ecryptfs_get_auth_tok_sig(&auth_tok_sig, auth_tok);