ecryptfs: re-order a condition for static checkers
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 22 Aug 2018 10:43:59 +0000 (13:43 +0300)
committerTyler Hicks <tyhicks@canonical.com>
Sat, 16 Feb 2019 22:42:48 +0000 (22:42 +0000)
Static checkers complain that we are using "s->i" as an offset before
we check whether it is within bounds.  It doesn't matter much but we
can easily swap the order of the checks to make everyone happy.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
fs/ecryptfs/keystore.c

index e74fe84d0886879c04cc26297f0e8b27db8281a6..624ff4409c61f22d9b196327e552a0e047df38e7 100644 (file)
@@ -1063,8 +1063,9 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
                       "rc = [%d]\n", __func__, rc);
                goto out_free_unlock;
        }
-       while (s->decrypted_filename[s->i] != '\0'
-              && s->i < s->block_aligned_filename_size)
+
+       while (s->i < s->block_aligned_filename_size &&
+              s->decrypted_filename[s->i] != '\0')
                s->i++;
        if (s->i == s->block_aligned_filename_size) {
                printk(KERN_WARNING "%s: Invalid tag 70 packet; could not "