diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-08-22 13:43:59 +0300 |
---|---|---|
committer | Tyler Hicks <tyhicks@canonical.com> | 2019-02-16 22:42:48 +0000 |
commit | 4b47a8b51e7bc0bcd1fa8e546a6333a04ab760d8 (patch) | |
tree | 0b05634cab3a03aa5bf5f057fa760c0d568eabce /fs/ecryptfs/keystore.c | |
parent | 0bdf8a8245fdea6f075a5fede833a5fcf1b3466c (diff) | |
download | linux-4b47a8b51e7bc0bcd1fa8e546a6333a04ab760d8.tar.gz linux-4b47a8b51e7bc0bcd1fa8e546a6333a04ab760d8.tar.bz2 linux-4b47a8b51e7bc0bcd1fa8e546a6333a04ab760d8.zip |
ecryptfs: re-order a condition for static checkers
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>
Diffstat (limited to 'fs/ecryptfs/keystore.c')
-rw-r--r-- | fs/ecryptfs/keystore.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c index e74fe84d0886..624ff4409c61 100644 --- a/fs/ecryptfs/keystore.c +++ b/fs/ecryptfs/keystore.c @@ -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 " |