lkml.org 
[lkml]   [2009]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[patch 4/8] md: use kzfree()
    Use kzfree() instead of memset() + kfree().

    Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Alasdair Kergon <dm-devel@redhat.com>
    ---
    drivers/md/dm-crypt.c | 6 ++----
    1 file changed, 2 insertions(+), 4 deletions(-)

    --- a/drivers/md/dm-crypt.c
    +++ b/drivers/md/dm-crypt.c
    @@ -1137,8 +1137,7 @@ bad_ivmode:
    crypto_free_ablkcipher(tfm);
    bad_cipher:
    /* Must zero key material before freeing */
    - memset(cc, 0, sizeof(*cc) + cc->key_size * sizeof(u8));
    - kfree(cc);
    + kzfree(cc);
    return -EINVAL;
    }

    @@ -1164,8 +1163,7 @@ static void crypt_dtr(struct dm_target *
    dm_put_device(ti, cc->dev);

    /* Must zero key material before freeing */
    - memset(cc, 0, sizeof(*cc) + cc->key_size * sizeof(u8));
    - kfree(cc);
    + kzfree(cc);
    }

    static int crypt_map(struct dm_target *ti, struct bio *bio,



    \
     
     \ /
      Last update: 2009-02-18 12:23    [W:0.021 / U:92.380 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site