lkml.org 
[lkml]   [2016]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 09/13] fscrypto: make fname_encrypt() actually return length of ciphertext
    Date
    This makes the return value match the comment.  Previously it would
    actually return 0 if encryption was successful. (No callers currently
    care.)

    Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
    ---
    fs/crypto/fname.c | 7 ++++---
    1 file changed, 4 insertions(+), 3 deletions(-)

    diff --git a/fs/crypto/fname.c b/fs/crypto/fname.c
    index e5c6959..5b10b73 100644
    --- a/fs/crypto/fname.c
    +++ b/fs/crypto/fname.c
    @@ -100,12 +100,13 @@ static int fname_encrypt(struct inode *inode,
    }
    kfree(alloc_buf);
    skcipher_request_free(req);
    - if (res < 0)
    + if (res < 0) {
    printk_ratelimited(KERN_ERR
    "%s: Error (error code %d)\n", __func__, res);
    -
    + return res;
    + }
    oname->len = ciphertext_len;
    - return res;
    + return ciphertext_len;
    }

    /*
    --
    2.7.4
    \
     
     \ /
      Last update: 2016-04-03 07:41    [W:4.648 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site