Skip to content

Commit

Permalink
storage: ree_fs_truncate(): fix reversed error checks
Browse files Browse the repository at this point in the history
Reported-by: Kevin Peng <kevinp@marvell.com>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
  • Loading branch information
jforissier committed Jan 25, 2018
1 parent e9596d0 commit 047c1d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/tee/tee_ree_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,15 +849,15 @@ static TEE_Result ree_fs_truncate(struct tee_file_handle *fh, size_t len)
mutex_lock(&ree_fs_mutex);

res = get_dirh(&dirh);
if (res != TEE_SUCCESS)
if (res)
goto out;

res = ree_fs_ftruncate_internal(fdp, len);
if (!res)
if (res)
goto out;

res = tee_fs_htree_sync_to_storage(&fdp->ht, fdp->dfh.hash);
if (!res)
if (res)
goto out;

res = tee_fs_dirfile_update_hash(dirh, &fdp->dfh);
Expand Down

0 comments on commit 047c1d0

Please sign in to comment.